]> git.sur5r.net Git - openldap/commitdiff
ITS#7759 avoid assert in parse_passwdpolicy_control
authorHoward Chu <hyc@openldap.org>
Sat, 7 Dec 2013 16:36:14 +0000 (08:36 -0800)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 7 Jan 2014 23:45:33 +0000 (17:45 -0600)
libraries/libldap/ppolicy.c

index 31f68cf136be6ebfe4dc0b6fdc93a8ef38fe5ca0..3bdb603d9141298ff325162e375043a907836033 100644 (file)
@@ -134,6 +134,11 @@ ldap_parse_passwordpolicy_control(
        assert( LDAP_VALID( ld ) );
        assert( ctrl != NULL );
 
+       if ( !ctrl->ldctl_value.bv_val ) {
+               ld->ld_errno = LDAP_DECODING_ERROR;
+               return(ld->ld_errno);
+       }
+
        /* Create a BerElement from the berval returned in the control. */
        ber = ber_init(&ctrl->ldctl_value);