poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1142880 - in /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model: BytePropertyNode.java PropertyNode.java
Date Tue, 05 Jul 2011 03:02:12 GMT
Author: sergey
Date: Tue Jul  5 03:02:12 2011
New Revision: 1142880

URL: http://svn.apache.org/viewvc?rev=1142880&view=rev
Log:
add additional sanity checks

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java?rev=1142880&r1=1142879&r2=1142880&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java Tue Jul 
5 03:02:12 2011
@@ -38,6 +38,11 @@ public abstract class BytePropertyNode e
 				translator.getCharIndex(fcEnd, translator.getCharIndex(fcStart)),
 				buf
 		);
+
+        if ( fcStart > fcEnd )
+            throw new IllegalArgumentException( "fcStart (" + fcStart
+                    + ") > fcEnd (" + fcEnd + ")" );
+
                 this.startBytes = fcStart;
                 this.endBytes = fcEnd;
 	}

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java?rev=1142880&r1=1142879&r2=1142880&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java Tue Jul  5 03:02:12
2011
@@ -56,6 +56,10 @@ public abstract class PropertyNode imple
     	  _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 + ")" );
   }
 
   /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message