public inbox for linux-erofs@ozlabs.org
 help / color / mirror / Atom feed
* [PATCH] erofs-utils: tar: guard NULL hardlink targets
@ 2026-03-26 17:40 Vansh Choudhary
  2026-03-26 17:52 ` Gao Xiang
  0 siblings, 1 reply; 3+ messages in thread
From: Vansh Choudhary @ 2026-03-26 17:40 UTC (permalink / raw)
  To: linux-erofs; +Cc: Vansh Choudhary

erofs_rebuild_get_dentry() can return NULL for empty or dot-style
paths. Treat that like an unresolved hardlink target instead of
dereferencing d2->type.

Signed-off-by: Vansh Choudhary <ch@vnsh.in>
---
 lib/tar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tar.c b/lib/tar.c
index 24e0413..4eb0060 100644
--- a/lib/tar.c
+++ b/lib/tar.c
@@ -1033,7 +1033,7 @@ out_eot:
 			ret = PTR_ERR(d2);
 			goto out;
 		}
-		if (d2->type == EROFS_FT_UNKNOWN) {
+		if (!d2 || d2->type == EROFS_FT_UNKNOWN) {
 			ret = -ENOENT;
 			goto out;
 		}
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-27 19:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-26 17:40 [PATCH] erofs-utils: tar: guard NULL hardlink targets Vansh Choudhary
2026-03-26 17:52 ` Gao Xiang
2026-03-27 19:37   ` [PATCH] erofs-utils: tests: add test for malformed tar " Vansh Choudhary

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox