diff options
| author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2021-09-02 15:20:40 +0200 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2021-09-08 10:41:28 -0400 |
| commit | 58e8dce449c8b0f1fb36c01de01fe7ed608f44d4 (patch) | |
| tree | 09e04ec236e600fdcfc86113fc97c9160fa33320 /csv.c | |
| parent | ecaf92ac2e34923b4b98e06e9d86e42ee18ae21f (diff) | |
| download | efi-boot-shim-58e8dce449c8b0f1fb36c01de01fe7ed608f44d4.tar.gz efi-boot-shim-58e8dce449c8b0f1fb36c01de01fe7ed608f44d4.zip | |
test-csv: test handling of trailing NUL byte
Data after a NUL byte should be ignored.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'csv.c')
| -rw-r--r-- | csv.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -77,6 +77,7 @@ parse_csv_data(char *data, char *data_end, size_t n_columns, list_t *list) end = data_end; max = (uintptr_t)end - (uintptr_t)line + (end > line ? 1 : 0); + /* Skip the delimiter(s) of the previous line */ while (max && found) { found = false; for (delim = &delims[0]; max && *delim; delim++) { @@ -87,6 +88,7 @@ parse_csv_data(char *data, char *data_end, size_t n_columns, list_t *list) } } } + /* Find the first delimiter of the current line */ for (delim = &delims[0]; *delim; delim++) { char *tmp = strnchrnul(line, max, *delim); if (tmp < end) |
