]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/compare.c
ITS#7920
[openldap] / libraries / libldap / compare.c
index 879caff5b7b1ce7cca0e1bc250c96cd204dc0631..755b26ea39b21e047a73dbd8a535eff056fb759b 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2006 The OpenLDAP Foundation.
+ * Copyright 1998-2014 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -153,7 +153,7 @@ ldap_compare_ext_s(
        if (  rc != LDAP_SUCCESS )
                return( rc );
 
-       if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 )
+       if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res )
                return( ld->ld_errno );
 
        return( ldap_result2error( ld, res, 1 ) );