Clear out-of-bounds read when fuzzing
zinflate.cpp:553:41: runtime error: index 30 out of bounds for type 'unsigned int [30]' zinflate.cpp:553:11: runtime error: load of address 0x0000011806b8 with insufficient space for an object of type 'const unsigned int' zinflate.cpp:32:32: runtime error: shift exponent 64 is too large for 64-bit type 'long unsigned int'pull/416/head
parent
093499260e
commit
9b383e8a07
|
|
@ -550,7 +550,9 @@ bool Inflator::DecodeBody()
|
|||
break;
|
||||
}
|
||||
case DISTANCE_BITS:
|
||||
bits = distanceExtraBits[m_distance];
|
||||
// TODO: this surfaced during fuzzing. What do we do???
|
||||
CRYPTOPP_ASSERT(m_distance < COUNTOF(distanceExtraBits));
|
||||
bits = (m_distance >= COUNTOF(distanceExtraBits)) ? distanceExtraBits[29] : distanceExtraBits[m_distance];
|
||||
if (!m_reader.FillBuffer(bits))
|
||||
{
|
||||
m_nextDecode = DISTANCE_BITS;
|
||||
|
|
|
|||
Loading…
Reference in New Issue