]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/ppolicy.c
ITS#8791 fix OpenSSL 1.1.1 BIO_method compat
[openldap] / libraries / libldap / ppolicy.c
index 31f68cf136be6ebfe4dc0b6fdc93a8ef38fe5ca0..4fca7c4a39f440e5ccc5805999f5a09f42804115 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2004-2013 The OpenLDAP Foundation.
+ * Copyright 2004-2017 The OpenLDAP Foundation.
  * Portions Copyright 2004 Hewlett-Packard Company.
  * Portions Copyright 2004 Howard Chu, Symas Corp.
  * All rights reserved.
@@ -81,7 +81,7 @@ ldap_create_passwordpolicy_control( LDAP *ld,
    
    ctrl         (IN)   The address of an
                                           LDAPControl structure, either obtained 
-                                          by running thorugh the list of response controls or
+                                          by running through the list of response controls or
                                           by a call to ldap_control_find().
 
    exptimep     (OUT)  This result parameter is filled in with the number of seconds before
@@ -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);