aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
authorTim Allison <tallison@apache.org>2018-08-08 17:30:02 +0000
committerTim Allison <tallison@apache.org>2018-08-08 17:30:02 +0000
commitdd246a4a67612d3726003d513248c1ea307c1dfb (patch)
tree03756feb8a5b1f32c9041f97d2f32bb414800aa9 /src/java/org
parent86a51e4b9bb3dbb041814e74a939762197132165 (diff)
downloadpoi-dd246a4a67612d3726003d513248c1ea307c1dfb.tar.gz
poi-dd246a4a67612d3726003d513248c1ea307c1dfb.zip
bug 62608 -- avoid ioobe in VBAMacroReader
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837664 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r--src/java/org/apache/poi/poifs/macros/VBAMacroReader.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java b/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java
index 6a5fa620a7..04402e58cb 100644
--- a/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java
+++ b/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java
@@ -591,9 +591,11 @@ public class VBAMacroReader implements Closeable {
for (String line : properties.split("\r\n|\n\r")) {
if (!line.startsWith("[")) {
String[] tokens = line.split("=");
- if (tokens.length > 1 && tokens[1].length() > 1 && tokens[1].startsWith("\"")) {
- // Remove any double qouates
- tokens[1] = tokens[1].substring(1, tokens[1].length() - 2);
+ if (tokens.length > 1 && tokens[1].length() > 1
+ && tokens[1].startsWith("\"") && tokens[1].endsWith("\"")) {
+ // Remove any double quotes
+ tokens[1] = tokens[1].substring(1, tokens[1].length() - 1);
+
}
if ("Document".equals(tokens[0])) {
String mn = tokens[1].substring(0, tokens[1].indexOf("/&H"));