directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r369521 - /directory/trunks/asn1/src/main/java/org/apache/asn1/util/IntegerDecoder.java
Date Mon, 16 Jan 2006 16:44:11 GMT
Author: elecharny
Date: Mon Jan 16 08:44:08 2006
New Revision: 369521

URL: http://svn.apache.org/viewcvs?rev=369521&view=rev
Log:
Fixed a NPE when the buffer is null.

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

Modified: directory/trunks/asn1/src/main/java/org/apache/asn1/util/IntegerDecoder.java
URL: http://svn.apache.org/viewcvs/directory/trunks/asn1/src/main/java/org/apache/asn1/util/IntegerDecoder.java?rev=369521&r1=369520&r2=369521&view=diff
==============================================================================
--- directory/trunks/asn1/src/main/java/org/apache/asn1/util/IntegerDecoder.java (original)
+++ directory/trunks/asn1/src/main/java/org/apache/asn1/util/IntegerDecoder.java Mon Jan 16
08:44:08 2006
@@ -48,6 +48,12 @@
 
         byte[] bytes  = value.getData();
 
+        if ( ( bytes == null ) || ( bytes.length == 0 ) )
+        {
+            throw new IntegerDecoderException(
+                "The value is 0 byte long. This is not allowed for an integer" );
+        }
+
         if ( bytes.length > 4 )
         {
             throw new IntegerDecoderException(



Mime
View raw message