From 5dfbb0d24dc572e18906cc4acfd95ab43a8567aa Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 20 May 2019 16:21:00 +0200 Subject: [PATCH] s3:lib: Move up NULL check Found by covscan. Signed-off-by: Andreas Schneider Reviewed-by: Gary Lockyer Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Fri May 24 07:23:42 UTC 2019 on sn-devel-184 --- source3/lib/popt_common_cmdline.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source3/lib/popt_common_cmdline.c b/source3/lib/popt_common_cmdline.c index 95abec1a440..79e34847f48 100644 --- a/source3/lib/popt_common_cmdline.c +++ b/source3/lib/popt_common_cmdline.c @@ -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; } -- 2.47.3