From 57267139832e5864577136475267f6ae8f730d6f Mon Sep 17 00:00:00 2001 From: XenoAmess Date: Sat, 16 Jul 2022 03:40:21 +0800 Subject: [PATCH] refine conditions --- poi/src/main/java/org/apache/poi/hpsf/TypedPropertyValue.java | 2 +- .../main/java/org/apache/poi/hssf/usermodel/HSSFSheet.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/poi/src/main/java/org/apache/poi/hpsf/TypedPropertyValue.java b/poi/src/main/java/org/apache/poi/hpsf/TypedPropertyValue.java index 1b4f5c64890..2be08b3b09d 100644 --- a/poi/src/main/java/org/apache/poi/hpsf/TypedPropertyValue.java +++ b/poi/src/main/java/org/apache/poi/hpsf/TypedPropertyValue.java @@ -255,7 +255,7 @@ static void skipPadding( LittleEndianByteArrayInputStream lei ) { for (int i=0; i row2) + if ((row1 > row2) || (row1 < 0 || row1 > maxRowIndex) || (row2 < 0 || row2 > maxRowIndex)) { throw new IllegalArgumentException("Invalid row range specification"); @@ -2561,7 +2561,7 @@ private void setRepeatingRowsAndColumns( if (colDef != null) { col1 = colDef.getFirstColumn(); col2 = colDef.getLastColumn(); - if ((col1 == -1 && col2 != -1) || (col1 > col2) + if ((col1 > col2) || (col1 < 0 || col1 > maxColIndex) || (col2 < 0 || col2 > maxColIndex)) { throw new IllegalArgumentException("Invalid column range specification");