From 7e7fad5e03141b627e2d400ee4999cf629d34eb0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Thu, 21 Apr 2022 12:14:06 +0100 Subject: [PATCH] ITS#9828 Fix ldap_count_values_len pointer confusion --- libraries/libldap/getvalues.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.47.3