Skip to content

Commit

Permalink
fix fluent#9368: unsigned integer overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Crispy-fried-chicken authored Sep 9, 2024
1 parent 072ffe7 commit 8539cfc
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/cmetrics/src/external/protobuf-c.c
Original file line number Diff line number Diff line change
Expand Up @@ -2604,10 +2604,13 @@ parse_required_member(ScannedMember *scanned_member,
return FALSE;

def_mess = scanned_member->field->default_value;
subm = protobuf_c_message_unpack(scanned_member->field->descriptor,
allocator,
len - pref_len,
data + pref_len);
if (len >= pref_len)
subm = protobuf_c_message_unpack(scanned_member->field->descriptor,
allocator,
len - pref_len,
data + pref_len);
else
subm = NULL;

if (maybe_clear &&
*pmessage != NULL &&
Expand Down

0 comments on commit 8539cfc

Please sign in to comment.