Skip to content

Commit

Permalink
OpenFileGDB: avoid harmless unsigned integer overflow (master only) (…
Browse files Browse the repository at this point in the history
…ossfuzz#69618)
  • Loading branch information
rouault committed Jun 14, 2024
1 parent 6c8342e commit 5481008
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ogr/ogrsf_frmts/openfilegdb/filegdbtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,10 @@ bool FileGDBTable::ReadTableXHeaderV4()
m_nTablxOffsetSize = GetUInt32(abyHeader + 12, 0);
returnErrorIf(m_nTablxOffsetSize < 4 || m_nTablxOffsetSize > 6);

returnErrorIf(m_n1024BlocksPresent >
(std::numeric_limits<vsi_l_offset>::max() - 16) /
(m_nTablxOffsetSize * 1024));

m_nOffsetTableXTrailer =
16 + m_nTablxOffsetSize * 1024 *
static_cast<vsi_l_offset>(m_n1024BlocksPresent);
Expand Down

0 comments on commit 5481008

Please sign in to comment.