Skip to content

Commit a1368f1

Browse files
committed
fix UB
1 parent 071c6e8 commit a1368f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

msgpack_unpack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ typedef struct var_entries {
6868
#define MSGPACK_VALIDATE_INPUT_DATA_LENGTH(data, len, eof) \
6969
((data) + (len) <= (eof))
7070
#define MSGPACK_VALIDATE_INPUT(user, data, len) \
71-
if (!MSGPACK_VALIDATE_INPUT_DATA_LENGTH(data, len, (user)->eof)) { \
71+
if ((len && !data) || !MSGPACK_VALIDATE_INPUT_DATA_LENGTH(data, len, (user)->eof)) { \
7272
return MSGPACK_UNPACK_PARSE_ERROR; \
7373
}
7474

0 commit comments

Comments
 (0)