directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r469846 - /directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponse.java
Date Wed, 01 Nov 2006 10:29:26 GMT
Author: elecharny
Date: Wed Nov  1 02:29:25 2006
New Revision: 469846

URL: http://svn.apache.org/viewvc?view=rev&rev=469846
Log:
Fixed bug DIRSERVER-761 (BufferOverflow in extendedResponse)

Modified:
    directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponse.java

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponse.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponse.java?view=diff&rev=469846&r1=469845&r2=469846
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponse.java
(original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponse.java
Wed Nov  1 02:29:25 2006
@@ -155,19 +155,19 @@
         {
             responseNameLength = responseName.toString().length();
             extendedResponseLength += 1 + TLV.getNbBytes( responseNameLength ) + responseNameLength;
+        }
 
-            if ( response != null )
+        if ( response != null )
+        {
+            if ( response instanceof String )
             {
-                if ( response instanceof String )
-                {
-                    int responseLength = StringTools.getBytesUtf8( ( String ) response ).length;
-                    extendedResponseLength += 1 + TLV.getNbBytes( responseLength ) + responseLength;
-                }
-                else
-                {
-                    extendedResponseLength += 1 + TLV.getNbBytes( ( ( byte[] ) response ).length
)
-                        + ( ( byte[] ) response ).length;
-                }
+                int responseLength = StringTools.getBytesUtf8( ( String ) response ).length;
+                extendedResponseLength += 1 + TLV.getNbBytes( responseLength ) + responseLength;
+            }
+            else
+            {
+                extendedResponseLength += 1 + TLV.getNbBytes( ( ( byte[] ) response ).length
)
+                    + ( ( byte[] ) response ).length;
             }
         }
 



Mime
View raw message