From: Yu Watanabe Date: Mon, 26 Dec 2022 07:41:17 +0000 (+0900) Subject: dissect: do not trigger assertion on error X-Git-Tag: v253-rc1~210^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5ffa6a0af4b45b0b7d97b854c3d03e5e82bfa6ee;p=thirdparty%2Fsystemd.git dissect: do not trigger assertion on error recurse_dir() does not provide 'sx' on error. Fixes #25862. --- diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c index a9212f11fbb..1d1b8ebc2d0 100644 --- a/src/dissect/dissect.c +++ b/src/dissect/dissect.c @@ -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 {