mirror of https://github.com/apache/poi.git
add additional sanity checks
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1142880 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
da719d5209
commit
8567b69858
|
@ -38,6 +38,11 @@ public abstract class BytePropertyNode extends PropertyNode {
|
|||
translator.getCharIndex(fcEnd, translator.getCharIndex(fcStart)),
|
||||
buf
|
||||
);
|
||||
|
||||
if ( fcStart > fcEnd )
|
||||
throw new IllegalArgumentException( "fcStart (" + fcStart
|
||||
+ ") > fcEnd (" + fcEnd + ")" );
|
||||
|
||||
this.startBytes = fcStart;
|
||||
this.endBytes = fcEnd;
|
||||
}
|
||||
|
|
|
@ -56,6 +56,10 @@ public abstract class PropertyNode implements Comparable, Cloneable
|
|||
_logger.log(POILogger.WARN, "A property claimed to start before zero, at " + _cpStart + "! Resetting it to zero, and hoping for the best");
|
||||
_cpStart = 0;
|
||||
}
|
||||
|
||||
if ( fcStart > fcEnd )
|
||||
throw new IllegalArgumentException( "fcStart (" + fcStart
|
||||
+ ") > fcEnd (" + fcEnd + ")" );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue