소스 검색

[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
tags/before_ooxml_3rd_edition
PJ Fanning 3 년 전
부모
커밋
20540f3c69
1개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 7
    4
      src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java

+ 7
- 4
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("");
}
}

Loading…
취소
저장