Skip to content

Commit b087939

Browse files
Parser: set *len = 0 in the last string chunk
Probably a good idea anyway, plus solves a false positive warning: src/compilersupport_p.h:192:34: error: ‘chunkLen’ may be used uninitialized in this function [-Werror=maybe-uninitialized] return __builtin_add_overflow(v1, v2, r); ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ src/cborparser.c:1163:16: note: ‘chunkLen’ was declared here size_t chunkLen = chunkLen; ^~~~~~~~ Signed-off-by: Thiago Macieira <[email protected]>
1 parent c3c7bf6 commit b087939

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/cborparser.c

+1
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,7 @@ static CborError get_string_chunk(CborValue *it, const void **bufferptr, size_t
10211021
++it->ptr;
10221022
last_chunk:
10231023
*bufferptr = NULL;
1024+
*len = 0;
10241025
return preparse_next_value(it);
10251026
} else if ((uint8_t)(*it->ptr & MajorTypeMask) == it->type) {
10261027
err = extract_length(it->parser, &it->ptr, len);

0 commit comments

Comments
 (0)