directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r438288 - /directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestGrammar.java
Date Tue, 29 Aug 2006 23:25:09 GMT
Author: elecharny
Date: Tue Aug 29 16:25:08 2006
New Revision: 438288

URL: http://svn.apache.org/viewvc?rev=438288&view=rev
Log:
Added a check for requestName : invalid OIDs were allowed.

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

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestGrammar.java?rev=438288&r1=438287&r2=438288&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestGrammar.java
(original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestGrammar.java
Tue Aug 29 16:25:08 2006
@@ -136,8 +136,23 @@
                     }
                     else
                     {
-                        extendedRequest
-                            .setRequestName( new OID( StringTools.utf8ToString( tlv.getValue().getData()
) ) );
+                        byte[] requestNameBytes = tlv.getValue().getData();
+                        
+                        try
+                        {
+                            OID oid = new OID( StringTools.utf8ToString( requestNameBytes
) );
+                            extendedRequest.setRequestName( oid );
+                        }
+                        catch ( DecoderException de )
+                        {
+                            String msg = "The Request name is not a valid OID : " + StringTools.utf8ToString(
requestNameBytes ) + 
+                            " (" + StringTools.dumpBytes( requestNameBytes )
+                            + ") is invalid";
+                            log.error( "{} : {}", msg, de.getMessage() );
+
+                            // Rethrow the exception, we will get a PROTOCOL_ERROR
+                            throw de;
+                        }
                     }
 
                     // We can have an END transition



Mime
View raw message