diff options
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 && |