diff options
author | PJ Fanning <fanningpj@apache.org> | 2020-07-15 20:42:16 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2020-07-15 20:42:16 +0000 |
commit | 20540f3c69eb1c48a0ebbd8c49bcfe6ea6f3e165 (patch) | |
tree | 13e49b0fea66f91363c7512e852cd64a92c2d6e3 /src/ooxml | |
parent | 709a3eb32c6e92cf4e3a93c7cbcdc0a19738b662 (diff) | |
download | poi-20540f3c69eb1c48a0ebbd8c49bcfe6ea6f3e165.tar.gz poi-20540f3c69eb1c48a0ebbd8c49bcfe6ea6f3e165.zip |
[bug-64508] add guard for invalid v value
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1879903 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml')
-rw-r--r-- | src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java index 9af9977cd6..1d440d2be2 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java @@ -374,10 +374,13 @@ public final class XSSFCell extends CellBase { rt = new XSSFRichTextString(_cell.isSetV() ? _cell.getV() : ""); } else { if (_cell.isSetV()) { - int idx = Integer.parseInt(_cell.getV()); - rt = new XSSFRichTextString(_sharedStringSource.getEntryAt(idx)); - } - else { + try { + int idx = Integer.parseInt(_cell.getV()); + rt = new XSSFRichTextString(_sharedStringSource.getEntryAt(idx)); + } catch(Throwable t) { + rt = new XSSFRichTextString(""); + } + } else { rt = new XSSFRichTextString(""); } } |