aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2018-12-08 08:13:36 +0000
committerPJ Fanning <fanningpj@apache.org>2018-12-08 08:13:36 +0000
commit740a756a3f28280e450f97525fd44d79eb9103e5 (patch)
tree55a41537ab77a9a3d36cc3babb10e4bd4c9a31cf /src/java
parentef75a6d2d2dda6ab20366954bd19e3e492bc5dc2 (diff)
downloadpoi-740a756a3f28280e450f97525fd44d79eb9103e5.tar.gz
poi-740a756a3f28280e450f97525fd44d79eb9103e5.zip
lgtm issues
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1848438 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/poi/ss/formula/functions/MatrixFunction.java2
-rw-r--r--src/java/org/apache/poi/util/StringUtil.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/java/org/apache/poi/ss/formula/functions/MatrixFunction.java b/src/java/org/apache/poi/ss/formula/functions/MatrixFunction.java
index 6b111cfc1a..04e7f4cd77 100644
--- a/src/java/org/apache/poi/ss/formula/functions/MatrixFunction.java
+++ b/src/java/org/apache/poi/ss/formula/functions/MatrixFunction.java
@@ -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;
}
}
diff --git a/src/java/org/apache/poi/util/StringUtil.java b/src/java/org/apache/poi/util/StringUtil.java
index 302e532570..2017abf125 100644
--- a/src/java/org/apache/poi/util/StringUtil.java
+++ b/src/java/org/apache/poi/util/StringUtil.java
@@ -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 = "?";