From d93053e9cca314179eea3fff202a32f8ec74b770 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 19 May 2023 17:26:57 +0300 Subject: unsigned integer overflow fix --- libs/libsignal/src/protobuf-c/protobuf-c.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'libs/libsignal') 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 && -- cgit v1.2.3