From: Ondřej Kuzník Date: Thu, 21 Apr 2022 11:14:06 +0000 (+0100) Subject: ITS#9828 Fix ldap_count_values_len pointer confusion X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e7fad5e03141b627e2d400ee4999cf629d34eb0;p=thirdparty%2Fopenldap.git ITS#9828 Fix ldap_count_values_len pointer confusion --- diff --git a/libraries/libldap/getvalues.c b/libraries/libldap/getvalues.c index b3ac1907f8..4e3d6c2827 100644 --- a/libraries/libldap/getvalues.c +++ b/libraries/libldap/getvalues.c @@ -159,7 +159,15 @@ ldap_count_values( char **vals ) int ldap_count_values_len( struct berval **vals ) { - return( ldap_count_values( (char **) vals ) ); + int i; + + if ( vals == NULL ) + return 0; + + for ( i = 0; !BER_BVISNULL( vals[i] ); i++ ) + ; /* NULL */ + + return i; } void