]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dissect: do not trigger assertion on error
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 26 Dec 2022 07:41:17 +0000 (16:41 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 26 Dec 2022 07:42:29 +0000 (16:42 +0900)
recurse_dir() does not provide 'sx' on error.

Fixes #25862.

src/dissect/dissect.c

index a9212f11fbb184b4a878145c7b3f366b3d868e89..1d1b8ebc2d01de1f5f833d47158761283078c0dc 100644 (file)
@@ -901,11 +901,12 @@ static int mtree_print_item(
         int r;
 
         assert(path);
-        assert(sx);
 
         if (IN_SET(event, RECURSE_DIR_ENTER, RECURSE_DIR_ENTRY)) {
                 _cleanup_free_ char *escaped = NULL;
 
+                assert(sx);
+
                 if (isempty(path))
                         path = ".";
                 else {