]> git.sur5r.net Git - openldap/commitdiff
return PROTOCOL_ERROR if reqdata is empty.
authorKurt Zeilenga <kurt@openldap.org>
Mon, 10 Jun 2002 19:56:17 +0000 (19:56 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 10 Jun 2002 19:56:17 +0000 (19:56 +0000)
servers/slapd/passwd.c

index 94cbeac0cf2d7631efd2376b40dd7655c4cde281..4bc064a0ad0e5846cf7cda5e1218398f87c24487 100644 (file)
@@ -88,6 +88,11 @@ int slap_passwd_parse( struct berval *reqdata,
                return LDAP_SUCCESS;
        }
 
+       if( reqdata->bv_len == 0 ) {
+               *text = "empty request data field";
+               return LDAP_PROTOCOL_ERROR;
+       }
+
        /* ber_init2 uses reqdata directly, doesn't allocate new buffers */
        ber_init2( ber, reqdata, 0 );
 
@@ -204,7 +209,6 @@ decoding_error:
                        (long) len, 0, 0 );
 #endif
 
-
                *text = "data decoding error";
                rc = LDAP_PROTOCOL_ERROR;
        }