Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cborparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ static CborError iterate_string_chunks(const CborValue *value, char *buffer, siz
return CborErrorDataTooLarge;

if (*result && *buflen >= newTotal)
*result = !!func(buffer + total, (const uint8_t *)ptr, chunkLen);
*result = !!func(buffer == NULL ? buffer : buffer + total, (const uint8_t *)ptr, chunkLen);
else
*result = false;

Expand All @@ -1221,7 +1221,7 @@ static CborError iterate_string_chunks(const CborValue *value, char *buffer, siz
/* is there enough room for the ending NUL byte? */
if (*result && *buflen > total) {
uint8_t nul[] = { 0 };
*result = !!func(buffer + total, nul, 1);
*result = !!func(buffer == NULL ? buffer : buffer + total, nul, 1);
}
*buflen = total;
return _cbor_value_finish_string_iteration(next);
Expand Down