Bug 66425: Avoid exceptions found via poi-fuzz

Prevent a NullPointerException

Fixes https://issues.oss-fuzz.com/issues/42537720

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1923061 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2025-01-11 09:24:20 +00:00
parent 76617e9793
commit 6befe2ad52
3 changed files with 5 additions and 0 deletions

View File

@ -240,6 +240,11 @@ public class AbstractWordUtils {
}
}
// ensure the format does not grow too large, number-format
// can be roman-numbers, where very large numbers would have
// very many "M" and thus may cause memory to overload
IOUtils.safelyAllocateCheck(num, MAX_BULLET_BUFFER_SIZE/10);
bulletBuffer.append( NumberFormatter.getNumber( num,
list.getNumberFormat( level ) ) );
} else {

Binary file not shown.