]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:utils: Check return value of samba_cmdline_init() (CID 1548345)
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 30 Oct 2023 22:20:05 +0000 (11:20 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 2 Nov 2023 03:08:37 +0000 (03:08 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/utils/wspsearch.c

index 6b918b9db94eef2c3c95b20a4da86965f96c49e3..d2235fa8193ede28a14093c1bd09df29519c312b 100644 (file)
@@ -591,10 +591,16 @@ int main(int argc, char **argv)
        struct dcerpc_binding_handle *h = NULL;
        struct cli_state *c = NULL;
        uint32_t flags = CLI_FULL_CONNECTION_IPC;
+       bool ok;
 
-       samba_cmdline_init(frame,
-                          SAMBA_CMDLINE_CONFIG_CLIENT,
-                          false /* require_smbconf */);
+       ok = samba_cmdline_init(frame,
+                               SAMBA_CMDLINE_CONFIG_CLIENT,
+                               false /* require_smbconf */);
+       if (!ok) {
+               DBG_ERR("Failed to set up cmdline parser\n");
+               result = -1;
+               goto out;
+       }
 
        pc = samba_popt_get_context("wspsearch",
                        argc,