poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From talli...@apache.org
Subject svn commit: r1837664 - /poi/trunk/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java
Date Wed, 08 Aug 2018 17:30:02 GMT
Author: tallison
Date: Wed Aug  8 17:30:02 2018
New Revision: 1837664

URL: http://svn.apache.org/viewvc?rev=1837664&view=rev
Log:
bug 62608 -- avoid ioobe in VBAMacroReader

Modified:
    poi/trunk/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java

Modified: poi/trunk/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java?rev=1837664&r1=1837663&r2=1837664&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java Wed Aug  8 17:30:02
2018
@@ -591,9 +591,11 @@ public class VBAMacroReader implements C
         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"));



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message