directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r369872 - /directory/trunks/asn1/src/main/java/org/apache/asn1/util/BooleanDecoder.java
Date Tue, 17 Jan 2006 19:15:43 GMT
Author: elecharny
Date: Tue Jan 17 11:15:39 2006
New Revision: 369872

URL: http://svn.apache.org/viewcvs?rev=369872&view=rev
Log:
Added a test agaisnt null values

Modified:
    directory/trunks/asn1/src/main/java/org/apache/asn1/util/BooleanDecoder.java

Modified: directory/trunks/asn1/src/main/java/org/apache/asn1/util/BooleanDecoder.java
URL: http://svn.apache.org/viewcvs/directory/trunks/asn1/src/main/java/org/apache/asn1/util/BooleanDecoder.java?rev=369872&r1=369871&r2=369872&view=diff
==============================================================================
--- directory/trunks/asn1/src/main/java/org/apache/asn1/util/BooleanDecoder.java (original)
+++ directory/trunks/asn1/src/main/java/org/apache/asn1/util/BooleanDecoder.java Tue Jan 17
11:15:39 2006
@@ -47,6 +47,12 @@
     {
         byte[] bytes  = value.getData();
 
+        if ( ( bytes == null ) || ( bytes.length == 0 ) )
+        {
+            throw new BooleanDecoderException(
+                "The value is 0 byte long. This is not allowed for a boolean" );
+        }
+
         if ( bytes.length != 1 )
         {
             throw new BooleanDecoderException(



Mime
View raw message