Commit 65323a6b authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

wldap32: Handle null LDAPMessage in ldap_count_entries.

parent 57828356
......@@ -98,6 +98,7 @@ ULONG CDECL WLDAP32_ldap_count_entries( LDAP *ld, WLDAP32_LDAPMessage *res )
{
TRACE( "(%p, %p)\n", ld, res );
if (!res) return 0;
if (!ld) return ~0u;
return ldap_count_entries( CTX(ld), MSG(res) );
}
......
......@@ -252,7 +252,13 @@ static void test_ldap_paged_search(void)
ok( res != NULL, "expected res != NULL\n" );
ok( count == 0, "got %lu\n", count );
count = ldap_count_entries( ld, res);
count = ldap_count_entries( NULL, NULL );
ok( count == 0, "got %lu\n", count );
count = ldap_count_entries( ld, NULL );
ok( count == 0, "got %lu\n", count );
count = ldap_count_entries( NULL, res );
todo_wine ok( count == 1, "got %lu\n", count );
count = ldap_count_entries( ld, res );
ok( count == 1, "got %lu\n", count );
entry = ldap_first_entry( ld, res);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment