]> source.dussan.org Git - poi.git/commit
Bug 66425: Avoid exceptions found via poi-fuzz
authorDominik Stadler <centic@apache.org>
Tue, 16 Jul 2024 13:26:16 +0000 (13:26 +0000)
committerDominik Stadler <centic@apache.org>
Tue, 16 Jul 2024 13:26:16 +0000 (13:26 +0000)
commit7b15aefae8222b2e61e4d52cddcdfdfff4e29a2b
tree7e0b19a3e46194f653c67f848bcce6cb33857c58
parentcc4fbe1c4dd4345d5fd946fba5e8b608b69a1ae4
Bug 66425: Avoid exceptions found via poi-fuzz

Avoid a possible OutOfMemoryException with incorrect uniqueCount

The ReadOnlySharedStringsTable pre-allocates whatever is stated in uniqueCount.

As the uniqueCount may be an incorrect large number, we should cap it at some point
to avoid OOMs if corrupt files are processed.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66137

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1919284 13f79535-47bb-0310-9956-ffa450edef68
poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java
poi-ooxml/src/test/java/org/apache/poi/xssf/eventusermodel/TestReadOnlySharedStringsTable.java