]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2023-34968: mdssvc: switch to doing an early return
authorRalph Boehme <slow@samba.org>
Tue, 20 Jun 2023 09:05:22 +0000 (11:05 +0200)
committerJule Anger <janger@samba.org>
Fri, 14 Jul 2023 13:16:30 +0000 (15:16 +0200)
Just reduce indentation of the code handling the success case. No change in
behaviour.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15388

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/rpc_server/mdssvc/mdssvc.c

index 72936a992890b5cf585faf2a065ea8738eb33941..92afa9e5fd49887c944ecaf2be7446abc7639541 100644 (file)
@@ -1817,19 +1817,21 @@ bool mds_dispatch(struct mds_ctx *mds_ctx,
        }
 
        ok = slcmd->function(mds_ctx, query, reply);
-       if (ok) {
-               DBG_DEBUG("%s", dalloc_dump(reply, 0));
-
-               len = sl_pack(reply,
-                             (char *)response_blob->spotlight_blob,
-                             response_blob->size);
-               if (len == -1) {
-                       DBG_ERR("error packing Spotlight RPC reply\n");
-                       ok = false;
-                       goto cleanup;
-               }
-               response_blob->length = len;
+       if (!ok) {
+               goto cleanup;
+       }
+
+       DBG_DEBUG("%s", dalloc_dump(reply, 0));
+
+       len = sl_pack(reply,
+                     (char *)response_blob->spotlight_blob,
+                     response_blob->size);
+       if (len == -1) {
+               DBG_ERR("error packing Spotlight RPC reply\n");
+               ok = false;
+               goto cleanup;
        }
+       response_blob->length = len;
 
 cleanup:
        talloc_free(query);