diff options
author | Dominik Stadler <centic@apache.org> | 2023-12-06 19:49:34 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2023-12-06 19:49:34 +0000 |
commit | 9fda604fb83a781ae581db06133583ae50394f3c (patch) | |
tree | e083ad8b8133340a98b3127e18b840303cb89718 /poi-ooxml | |
parent | e0b7dcda83288307c1ad7b656f0215d990c6ed05 (diff) | |
download | poi-9fda604fb83a781ae581db06133583ae50394f3c.tar.gz poi-9fda604fb83a781ae581db06133583ae50394f3c.zip |
Bug 66425: Avoid exceptions found via poi-fuzz
Capture and report integer overflow as normal
parsing/format exceptions
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63628
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1914401 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java | 2 | ||||
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java index fd008f3a3d..c79024e3b4 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java @@ -289,7 +289,7 @@ public class XSSFEventBasedExcelExtractor } return text.toString(); - } catch (IOException | OpenXML4JException | SAXException e) { + } catch (IOException | OpenXML4JException | SAXException | NumberFormatException e) { LOGGER.atWarn().withThrowable(e).log("Failed to load text"); return ""; } diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java index 9fe2ea71f0..f931b2d58d 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java @@ -146,7 +146,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet, OoxmlSheetEx protected void onDocumentRead() { try (InputStream stream = getPackagePart().getInputStream()) { read(stream); - } catch (IOException e){ + } catch (IOException | ArithmeticException e){ throw new POIXMLException(e); } } |