From 3bd00bf7bd9aab03b1e7e0a36fe608719739ee09 Mon Sep 17 00:00:00 2001 From: Gao Xiang Date: Thu, 9 Jan 2025 13:05:14 +0800 Subject: [PATCH] erofs-utils: mkfs: fix crash when failing to build tree For example: It crashes instead of cleanly erroring out if there's a file for which it doesn't have permissions to read (e.g. /etc/gshadow has mode 000). Reported-by: Jonathan Lebon Fixes: 6a8e395ae4fd ("erofs-utils: fix up root inode for incremental builds") Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20250109050514.3836023-1-hsiangkao@linux.alibaba.com --- mkfs/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mkfs/main.c b/mkfs/main.c index 0f6a32b..daea33d 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -1439,6 +1439,7 @@ int main(int argc, char **argv) root = erofs_mkfs_build_tree_from_path(&g_sbi, cfg.c_src_path); if (IS_ERR(root)) { err = PTR_ERR(root); + root = NULL; goto exit; } } -- 2.34.1