From 64d5725662d33a168055df6db2ea06c366a1d0f1 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 28 Jun 1999 22:47:20 +0000 Subject: [PATCH] Allow ctrls argument to be NULL. --- libraries/libldap/controls.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/libldap/controls.c b/libraries/libldap/controls.c index b609b7bc56..a5efc952dc 100644 --- a/libraries/libldap/controls.c +++ b/libraries/libldap/controls.c @@ -117,8 +117,10 @@ int ldap_int_get_controls( char *opaque; assert( ber != NULL ); - assert( ctrls != NULL ); + if( ctrls == NULL ) { + return LDAP_SUCCESS; + } *ctrls = NULL; len = ber_pvt_ber_remaining(ber); @@ -128,6 +130,7 @@ int ldap_int_get_controls( return LDAP_SUCCESS; } + if(( tag = ber_peek_tag( ber, &len )) != LDAP_TAG_CONTROLS ) { if( tag == LBER_ERROR ) { /* decoding error */ -- 2.39.5