]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/ppolicy.c
Happy New Year!
[openldap] / libraries / libldap / ppolicy.c
index c0d2390221a5c69da61bcd8e8edc8dee30c4255a..aca73fa7a2c3a93ea274e2b48a8e0e91cdbaa640 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2004-2012 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.
@@ -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);