]> source.dussan.org Git - poi.git/commitdiff
lgtm issues
authorPJ Fanning <fanningpj@apache.org>
Sat, 8 Dec 2018 08:13:36 +0000 (08:13 +0000)
committerPJ Fanning <fanningpj@apache.org>
Sat, 8 Dec 2018 08:13:36 +0000 (08:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1848438 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/ss/formula/functions/MatrixFunction.java
src/java/org/apache/poi/util/StringUtil.java
src/ooxml/java/org/apache/poi/ooxml/util/POIXMLConstants.java

index 6b111cfc1ab51f05acfb12f06450297915c7348e..04e7f4cd77a81b49cf19d820406f35a42eff6c25 100644 (file)
@@ -63,7 +63,7 @@ public abstract class MatrixFunction implements Function{
                     i = 0;
                     j++;
                 }
-                matrix[j][i++] = aVector;
+                if (j < matrix.length) matrix[j][i++] = aVector;
             }
         }
         
index 302e532570aa1d2d4b75af6029b7048387cd4cc0..2017abf125d3ab90e92cbead22dc2755740016d5 100644 (file)
@@ -698,7 +698,7 @@ public class StringUtil {
         final String prefix;
 
         // #61881 - for now we only check the first char
-        if (len > 0 && string[offset] == 0 && string[offset+1] == 0) {
+        if (len > 0 && offset < (string.length - 1) && string[offset] == 0 && string[offset+1] == 0) {
             newOffset = offset+2;
             prefix = "?";
 
index ab58e35833bca1fbb0e9e5e888cc5ab1ff639fcb..c6d7935fdaa22fe50f6b414803dbd2f85bb39814 100644 (file)
@@ -20,6 +20,7 @@ package org.apache.poi.ooxml.util;
 public class POIXMLConstants {
     public static final String FEATURE_LOAD_DTD_GRAMMAR = "http://apache.org/xml/features/nonvalidating/load-dtd-grammar";
     public static final String FEATURE_LOAD_EXTERNAL_DTD = "http://apache.org/xml/features/nonvalidating/load-external-dtd";
+    public static final String FEATURE_DISALLOW_DOCTYPE_DECL = "http://apache.org/xml/features/disallow-doctype-decl";
     public static final String PROPERTY_ENTITY_EXPANSION_LIMIT = "http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit";
     public static final String PROPERTY_SECURITY_MANAGER = "http://apache.org/xml/properties/security-manager";
 }