diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java b/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java index 4ceb2d1d8..59ac18e7b 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java @@ -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; } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java b/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java index e3338fd61..6c5a23972 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java @@ -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 + ")" ); } /**