From: Luca Boccassi Date: Thu, 4 Jan 2024 11:47:18 +0000 (+0100) Subject: dissect: add assert to guide static analysis X-Git-Tag: v256-rc1~1285^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43108bf87a432663e58d65d3e7f022779e626fd9;p=thirdparty%2Fsystemd.git dissect: add assert to guide static analysis CID#1533112 --- diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c index 10af26888e5..ce4a99bc0be 100644 --- a/src/dissect/dissect.c +++ b/src/dissect/dissect.c @@ -1709,6 +1709,8 @@ static int action_detach(const char *path) { struct stat st; int r; + assert(path); + fd = open(path, O_PATH|O_CLOEXEC); if (fd < 0) return log_error_errno(errno, "Failed to open '%s': %m", path);