directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r322524 - /directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/FilterGrammar.java
Date Sun, 16 Oct 2005 23:17:07 GMT
Author: elecharny
Date: Sun Oct 16 16:17:01 2005
New Revision: 322524

URL: http://svn.apache.org/viewcvs?rev=322524&view=rev
Log:
Fixed the special case where an assertin String is null. It wasn't handle, leading to a NPE

Modified:
    directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/FilterGrammar.java

Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/FilterGrammar.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/FilterGrammar.java?rev=322524&r1=322523&r2=322524&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/FilterGrammar.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/FilterGrammar.java
Sun Oct 16 16:17:01 2005
@@ -483,7 +483,14 @@
                         SearchRequest searchRequest = ldapMessage.getSearchRequest();
 
                         TLV tlv            = ldapMessageContainer.getCurrentTLV();
-                        OctetString assertionValue = new OctetString(tlv.getValue().getData());
+                        
+                        // The value can be null.
+                        OctetString assertionValue = OctetString.EMPTY_STRING;
+
+                        if ( tlv.getLength().getLength() != 0 )
+                        {
+                            assertionValue = new OctetString(tlv.getValue().getData());
+                        }
                         
                         AttributeValueAssertionFilter currentFilter = (AttributeValueAssertionFilter)searchRequest.getCurrentFilter();
                         AttributeValueAssertion assertion = currentFilter.getAssertion();



Mime
View raw message