Skip to contentSkip to conversation

erofs-utils: mkfs: fix crash when failing to build tree

PATCH New Gao Xiang 1 participant 1 message Jan 9, 2025

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/1 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).

Fixes 6a8e395ae4fd ("erofs-utils: fix up root inode for incremental builds")
---
 mkfs/main.c | 1 +
 1 file changed, 1 insertion(+)
mkfs/main.c +1 -0
index 2988c65..624b191 100644
@@ -1450,6 +1450,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;
 		}
 	}
Signature · 1 line
2.43.5