Describe the bug
|
/// Decode a signed long from `buf` |
|
pub fn long(&mut self, buf: &mut &[u8]) -> Option<i64> { |
|
while let Some(byte) = buf.first().copied() { |
|
*buf = &buf[1..]; |
|
self.in_progress |= ((byte & 0x7F) as u64) << self.shift; |
|
self.shift += 7; |
|
if byte & 0x80 == 0 { |
|
let val = self.in_progress; |
|
self.in_progress = 0; |
|
self.shift = 0; |
|
return Some((val >> 1) as i64 ^ -((val & 1) as i64)); |
|
} |
|
} |
|
None |
|
} |
malformed/malicious input could cause this loop to run more than expected for a valid input and cause panic/overflow
see related PR:
To Reproduce
No response
Expected behavior
No response
Additional context
No response
Describe the bug
arrow-rs/arrow-avro/src/reader/vlq.rs
Lines 31 to 45 in d8d980b
malformed/malicious input could cause this loop to run more than expected for a valid input and cause panic/overflow
see related PR:
To Reproduce
No response
Expected behavior
No response
Additional context
No response