]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#8180 back-sock: return error when str2entry fails
authorHoward Chu <hyc@openldap.org>
Thu, 2 Nov 2023 17:49:42 +0000 (17:49 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 14 Nov 2023 17:02:18 +0000 (17:02 +0000)
servers/slapd/back-sock/result.c

index 55a4060875492663accc54c3ef7e1066407b360b..439cea14a478a8d4ba6b1d65b7591f1978709ed0 100644 (file)
@@ -105,6 +105,10 @@ sock_read_and_send_results(
                        if ( (rs->sr_entry = str2entry( buf )) == NULL ) {
                                Debug( LDAP_DEBUG_ANY, "str2entry(%s) failed\n",
                                    buf );
+                               rs->sr_err = LDAP_OTHER;
+                               rs->sr_text = "str2entry failed";
+                               goto fail;
+
                        } else {
                                rs->sr_attrs = op->oq_search.rs_attrs;
                                rs->sr_flags = REP_ENTRY_MODIFIABLE;
@@ -118,6 +122,7 @@ sock_read_and_send_results(
        }
        (void) str2result( buf, &rs->sr_err, (char **)&rs->sr_matched, (char **)&rs->sr_text );
 
+fail:
        /* otherwise, front end will send this result */
        if ( rs->sr_err != 0 || op->o_tag != LDAP_REQ_BIND ) {
                send_ldap_result( op, rs );