From: Christian Göttsche Date: Thu, 26 Jan 2023 20:03:56 +0000 (+0100) Subject: lib/btrfs: avoid NULL-dereference X-Git-Tag: 4.15.0-rc1~220 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54ab542887994f8b6e5411469d6867e3a2e58800;p=thirdparty%2Fshadow.git lib/btrfs: avoid NULL-dereference btrfs.c:42:13: warning: use of NULL 'cmd' where non-null expected [CWE-476] [-Wanalyzer-null-argument] Reviewed-by: Alejandro Colomar --- diff --git a/libmisc/btrfs.c b/libmisc/btrfs.c index a2563f7c3..03915981c 100644 --- a/libmisc/btrfs.c +++ b/libmisc/btrfs.c @@ -39,7 +39,7 @@ static int run_btrfs_subvolume_cmd(const char *subcmd, const char *arg1, const c NULL }; - if (access(cmd, X_OK)) { + if (!cmd || access(cmd, X_OK)) { return 1; }