squashfs-tools/0006-pseudo-fix-possible-dereference-of-NULL-pointer.patch
lihaoxiang 31bf3d737e fix dereference of null pointer
(cherry picked from commit 4fe1bd1b7215aaef5348058ee10fc80697c0df4b)
2022-10-20 16:39:51 +08:00

25 lines
852 B
Diff

From 787faa3201b923cb91c74bc31c9f59610aca52e2 Mon Sep 17 00:00:00 2001
From: Phillip Lougher <phillip@squashfs.org.uk>
Date: Wed, 14 Sep 2022 21:23:24 +0100
Subject: [PATCH] pseudo: fix possible dereference of NULL pointer
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
---
squashfs-tools/pseudo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/squashfs-tools/pseudo.c b/squashfs-tools/pseudo.c
index 5f18bf1..942b98b 100644
--- a/squashfs-tools/pseudo.c
+++ b/squashfs-tools/pseudo.c
@@ -472,7 +472,7 @@ static int read_pseudo_def_pseudo_link(char *orig_def, char *filename, char *nam
else
pseudo_ent = pseudo_lookup(pseudo, link);
- if(pseudo_ent == NULL) {
+ if(pseudo_ent == NULL || pseudo_ent->dev == NULL) {
ERROR("Pseudo LINK file %s doesn't exist\n", linkname);
goto error;
}
--
2.37.0.windows.1