]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:lib: Move up NULL check
authorAndreas Schneider <asn@samba.org>
Mon, 20 May 2019 14:21:00 +0000 (16:21 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 24 May 2019 07:23:42 +0000 (07:23 +0000)
Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri May 24 07:23:42 UTC 2019 on sn-devel-184

source3/lib/popt_common_cmdline.c

index 95abec1a4409e7ebfb0a80b7561c92b0937c977b..79e34847f48d2743fab4ce3895c2d01df87a613e 100644 (file)
@@ -198,6 +198,10 @@ void popt_burn_cmdline_password(int argc, char *argv[])
 
        for (i = 0; i < argc; i++) {
                p = argv[i];
+               if (p == NULL) {
+                       return;
+               }
+
                if (strncmp(p, "-U", 2) == 0) {
                        ulen = 2;
                        found = true;
@@ -207,10 +211,6 @@ void popt_burn_cmdline_password(int argc, char *argv[])
                }
 
                if (found) {
-                       if (p == NULL) {
-                               return;
-                       }
-
                        if (strlen(p) == ulen) {
                                continue;
                        }