]> source.dussan.org Git - poi.git/commitdiff
Avoid stackoverflow exception that can be caused by a corrupted slideshow file
authorDominik Stadler <centic@apache.org>
Sat, 22 Jan 2022 06:58:39 +0000 (06:58 +0000)
committerDominik Stadler <centic@apache.org>
Sat, 22 Jan 2022 06:58:39 +0000 (06:58 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897318 13f79535-47bb-0310-9956-ffa450edef68

poi/src/main/java/org/apache/poi/ddf/AbstractEscherOptRecord.java

index 1fdf63380e82f0c526446013bd68d99ba5ed476c..536e590a2d7f9280146d4e21e00495fb2e836024 100644 (file)
@@ -55,6 +55,9 @@ public abstract class AbstractEscherOptRecord extends EscherRecord {
             EscherRecordFactory recordFactory )
     {
         int bytesRemaining = readHeader( data, offset );
+        if (bytesRemaining < 0) {
+            throw new IllegalStateException("Invalid value for bytesRemaining: " + bytesRemaining);
+        }
         short propertiesCount = readInstance( data, offset );
         int pos = offset + 8;