diff options
author | George Hazan <george.hazan@gmail.com> | 2023-05-19 17:26:57 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-05-19 17:26:57 +0300 |
commit | d93053e9cca314179eea3fff202a32f8ec74b770 (patch) | |
tree | 5096c1d45bad53a8150a4b818bdff8ef4c4115d6 /libs/libsignal | |
parent | e47f92127158a7f8044e1c10e0908f88ddb52cb3 (diff) |
unsigned integer overflow fix
Diffstat (limited to 'libs/libsignal')
-rw-r--r-- | libs/libsignal/src/protobuf-c/protobuf-c.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/libsignal/src/protobuf-c/protobuf-c.c b/libs/libsignal/src/protobuf-c/protobuf-c.c index 4f2f5bcc73..7ea4643c1d 100644 --- a/libs/libsignal/src/protobuf-c/protobuf-c.c +++ b/libs/libsignal/src/protobuf-c/protobuf-c.c @@ -2456,10 +2456,11 @@ 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); if (maybe_clear && *pmessage != NULL && |