Bug 66425: Avoid exceptions found via poi-fuzz

Prevent a NullPointerException

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

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1923059 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2025-01-11 09:24:08 +00:00
parent edcbd87360
commit 57afb34a18
3 changed files with 4 additions and 0 deletions

View File

@ -364,6 +364,10 @@ public class SlideShowExtractor<
// PowerPoint seems to store files with \r as the line break // PowerPoint seems to store files with \r as the line break
// The messes things up on everything but a Mac, so translate them to \n // The messes things up on everything but a Mac, so translate them to \n
String txt = tr.getRawText(); String txt = tr.getRawText();
if (txt == null) {
return "";
}
txt = txt.replace('\r', '\n'); txt = txt.replace('\r', '\n');
txt = txt.replace((char) 0x0B, sep); txt = txt.replace((char) 0x0B, sep);

Binary file not shown.