You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2006/01/17 20:15:43 UTC

svn commit: r369872 - /directory/trunks/asn1/src/main/java/org/apache/asn1/util/BooleanDecoder.java

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(