directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 30897 - incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber
Date Thu, 29 Jul 2004 05:02:35 GMT
Author: akarasulu
Date: Wed Jul 28 22:02:34 2004
New Revision: 30897

Modified:
   incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/BERDecoder.java
Log:
caught some bugs in handling of indeterminate termination with 00 sequences

Modified: incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/BERDecoder.java
==============================================================================
--- incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/BERDecoder.java
(original)
+++ incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/BERDecoder.java
Wed Jul 28 22:02:34 2004
@@ -271,8 +271,12 @@
             tlv.typeClass = tag.getTypeClass() ;
             tlv.index = tag.size() ;
 
-            fireTagDecoded() ;
-            updateStack( tag.size() ) ;
+            if ( ! tlv.isIndefinateTerminator() )
+            {
+                fireTagDecoded() ;
+                updateStack( tag.size() ) ;
+            }
+
             state = state.getNext( tag.isPrimitive() ) ;
         }
         else if ( decoder == lengthDecoder )
@@ -289,8 +293,11 @@
             {    
                 tlv.index += length.size() ;
             }
-            
-            fireLengthDecoded() ;
+
+            if ( ! tlv.isIndefinateTerminator() )
+            {
+                fireLengthDecoded() ;
+            }
             updateStack( length.size() ) ;
             
             if ( ! tlv.isPrimitive )
@@ -442,6 +449,7 @@
                 state = BERDecoderState.VALUE ;
                 fireDecodeOccurred( top ) ;
                 state = BERDecoderState.TAG ;
+                break;
             }
             else if ( top.isIndefinate() )
             {

Mime
View raw message