From c700f3bdf707da1f5d5eb973de4dfe0108ec78f6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 29 Oct 2019 19:05:15 +0100 Subject: [PATCH] Remove asserts from wxZipHeader::ReadNN() methods They prevent fuzzing from working properly as the program aborts instead of continuing and crashing if it mishandles incorrect input, so just remove them -- they didn't add any safety anyhow, as asserts are dormant by default in release builds. --- src/common/zipstrm.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/common/zipstrm.cpp b/src/common/zipstrm.cpp index e77f37411b..34ae8e66a4 100644 --- a/src/common/zipstrm.cpp +++ b/src/common/zipstrm.cpp @@ -251,13 +251,11 @@ wxZipHeader::wxZipHeader(const char* data, size_t size) inline wxUint8 wxZipHeader::Read8() { - wxASSERT(m_pos < m_size); return m_data[m_pos++]; } inline wxUint16 wxZipHeader::Read16() { - wxASSERT(m_pos + 2 <= m_size); wxUint16 n = CrackUint16(m_data + m_pos); m_pos += 2; return n; @@ -265,7 +263,6 @@ inline wxUint16 wxZipHeader::Read16() inline wxUint32 wxZipHeader::Read32() { - wxASSERT(m_pos + 4 <= m_size); wxUint32 n = CrackUint32(m_data + m_pos); m_pos += 4; return n; @@ -273,7 +270,6 @@ inline wxUint32 wxZipHeader::Read32() inline wxUint64 wxZipHeader::Read64() { - wxASSERT(m_pos + 8 <= m_size); wxUint64 n = CrackUint64(m_data + m_pos); m_pos += 8; return n;