!21 [sync] PR-19: 修复空指针反引用问题

From: @openeuler-sync-bot 
Reviewed-by: @liuzhiqiang26 
Signed-off-by: @liuzhiqiang26
This commit is contained in:
openeuler-ci-bot 2022-10-21 07:50:58 +00:00 committed by Gitee
commit 26de6ac9c8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,25 @@
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

View File

@ -1,6 +1,6 @@
Name: squashfs-tools
Version: 4.5
Release: 1
Release: 2
Summary: Utility for the squashfs filesystems
License: GPLv2+
URL: http://squashfs.sourceforge.net/
@ -12,6 +12,7 @@ Patch2: 0002-CVE-2021-41072.patch
Patch3: 0003-CVE-2021-41072.patch
Patch4: 0004-CVE-2021-41072.patch
Patch5: 0005-CVE-2021-41072.patch
Patch6: 0006-pseudo-fix-possible-dereference-of-NULL-pointer.patch
BuildRequires: zlib-devel xz-devel libzstd-devel
BuildRequires: lzo-devel libattr-devel lz4-devel gcc
@ -42,6 +43,9 @@ install -D -m 755 squashfs-tools/unsquashfs %{buildroot}%{_sbindir}/unsquashfs
%changelog
* Thu Oct 20 2022 lihaoxiang <lihaoxiang9@huawei.com> - 4.5-2
- fix dereference of null pointer
* Thu Nov 25 2021 yanglongkang <yanglongkang@huawei.com> - 4.5-1
- update to 4.5