diff options
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/poi/ss/formula/functions/MatrixFunction.java | 2 | ||||
-rw-r--r-- | src/java/org/apache/poi/util/StringUtil.java | 2 |
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 = "?"; |