mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Adds extra checks when decoding binary integers.
This commit is contained in:
parent
9a57dd6dc8
commit
2a35b00d16
1 changed files with 4 additions and 0 deletions
4
util.c
4
util.c
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue