Adds extra checks when decoding binary integers.

This commit is contained in:
Andrea Mazzoleni 2013-08-19 11:18:50 +02:00
parent 9a57dd6dc8
commit 2a35b00d16

4
util.c
View file

@ -522,6 +522,8 @@ loop:
if ((b & 0x80) == 0) {
v |= (uint32_t)b << s;
s += 7;
if (s >= 32)
return -1;
goto loop;
}
@ -550,6 +552,8 @@ loop:
if ((b & 0x80) == 0) {
v |= (uint64_t)b << s;
s += 7;
if (s >= 64)
return -1;
goto loop;
}