mirror of https://github.com/apache/poi.git
Bug 66425: Avoid a NullPointerException found via oss-fuzz
We try to avoid throwing NullPointerException, but it was possible to trigger one here with a specially crafted input-file Should fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62074 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1912125 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
35901849f1
commit
4b03c24ec8
|
@ -380,6 +380,10 @@ public class XSSFReader {
|
|||
*/
|
||||
@Override
|
||||
public InputStream next() {
|
||||
if (!sheetIterator.hasNext()) {
|
||||
throw new IllegalStateException("Cannot get next from iterator");
|
||||
}
|
||||
|
||||
xssfSheetRef = sheetIterator.next();
|
||||
|
||||
String sheetId = xssfSheetRef.getId();
|
||||
|
|
|
@ -831,7 +831,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
|
|||
private XSSFName createAndStoreName(CTDefinedName ctName) {
|
||||
XSSFName name = new XSSFName(ctName, this);
|
||||
namedRanges.add(name);
|
||||
namedRangesByName.put(ctName.getName().toLowerCase(Locale.ENGLISH), name);
|
||||
namedRangesByName.put(ctName.getName() == null ? null : ctName.getName().toLowerCase(Locale.ENGLISH), name);
|
||||
return name;
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue