directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1748905 - /directory/shared/branches/shared-value/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyRequestDecorator.java
Date Sat, 18 Jun 2016 04:33:28 GMT
Author: elecharny
Date: Sat Jun 18 04:33:28 2016
New Revision: 1748905

URL: http://svn.apache.org/viewvc?rev=1748905&view=rev
Log:
Fixed a potential NPE when the Value is null.

Modified:
    directory/shared/branches/shared-value/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyRequestDecorator.java

Modified: directory/shared/branches/shared-value/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyRequestDecorator.java?rev=1748905&r1=1748904&r2=1748905&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyRequestDecorator.java
(original)
+++ directory/shared/branches/shared-value/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyRequestDecorator.java
Sat Jun 18 04:33:28 2016
@@ -449,7 +449,16 @@ public class ModifyRequestDecorator exte
                 {
                     for ( Value value : modification.getAttribute() )
                     {
-                        localValuesLength += 1 + TLV.getNbBytes( value.getBytes().length
) + value.getBytes().length;
+                        byte[] valueBytes = value.getBytes();
+                        
+                        if ( valueBytes != null )
+                        {
+                            localValuesLength += 1 + TLV.getNbBytes( valueBytes.length )
+ valueBytes.length;
+                        }
+                        else
+                        {
+                            localValuesLength += 1 + 1;
+                        }
                     }
                 }
 



Mime
View raw message