Avoid stackoverflow exception that can be caused by a corrupted slideshow file

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897318 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2022-01-22 06:58:39 +00:00
parent 53599d84a7
commit 8f1c84c3fa
1 changed files with 3 additions and 0 deletions

View 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;