]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9828 Fix ldap_count_values_len pointer confusion
authorOndřej Kuzník <ondra@mistotebe.net>
Thu, 21 Apr 2022 11:14:06 +0000 (12:14 +0100)
committerOndřej Kuzník <ondra@mistotebe.net>
Thu, 21 Apr 2022 11:14:06 +0000 (12:14 +0100)
libraries/libldap/getvalues.c

index b3ac1907f83649de5895ed00638742194924d503..4e3d6c28270a3041831991c5f527194b6ee68071 100644 (file)
@@ -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