!110 [sync] PR-107: Backport patche from upstream community
From: @openeuler-sync-bot Reviewed-by: @HuaxinLuGitee Signed-off-by: @HuaxinLuGitee
This commit is contained in:
commit
05637957da
25
backport-Set-command_info-to-NULL-once-it-is-freed.patch
Normal file
25
backport-Set-command_info-to-NULL-once-it-is-freed.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From 0bb41ed82a5849b0c64d7046662825d84e983e4d Mon Sep 17 00:00:00 2001
|
||||
From: Rose <83477269+AtariDreams@users.noreply.github.com>
|
||||
Date: Mon, 26 Jun 2023 15:08:51 -0400
|
||||
Subject: [PATCH] Set command_info to NULL once it is freed
|
||||
|
||||
The lack of setting to NULL is a holdover from when command_info was a local variable and not a global one. However, we given how other global variables are set to NULL, it is best that we do the same here to avoid potential issues should sudoers_policy_store_result be called again after the first time failed, otherwise we could get a double-free.
|
||||
|
||||
---
|
||||
plugins/sudoers/policy.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/plugins/sudoers/policy.c b/plugins/sudoers/policy.c
|
||||
index 7157fab2b..f018caca2 100644
|
||||
--- a/plugins/sudoers/policy.c
|
||||
+++ b/plugins/sudoers/policy.c
|
||||
@@ -1054,6 +1054,7 @@ bad:
|
||||
while (info_len--)
|
||||
free(command_info[info_len]);
|
||||
free(command_info);
|
||||
+ command_info = NULL;
|
||||
debug_return_bool(false);
|
||||
}
|
||||
|
||||
--
|
||||
2.23.0
|
||||
@ -1,6 +1,6 @@
|
||||
Name: sudo
|
||||
Version: 1.9.8p2
|
||||
Release: 13
|
||||
Release: 14
|
||||
Summary: Allows restricted root access for specified users
|
||||
License: ISC
|
||||
URL: http://www.courtesan.com/sudo/
|
||||
@ -37,6 +37,7 @@ Patch23: backport-sudoers_main-defer-setting-return-value-until-the-en.patch
|
||||
Patch24: backport-sudo_putenv_nodebug-require-that-the-environment-str.patch
|
||||
Patch25: backport-Linux-execve-2-allows-argv-or-envp-to-be-NULL.patch
|
||||
Patch26: backport-Fix-potential-NULL-pointer-deference-found-by-clang-.patch
|
||||
Patch27: backport-Set-command_info-to-NULL-once-it-is-freed.patch
|
||||
|
||||
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Requires: pam
|
||||
@ -187,6 +188,9 @@ install -p -c -m 0644 %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/sudo-i
|
||||
%exclude %{_pkgdocdir}/ChangeLog
|
||||
|
||||
%changelog
|
||||
* Mon Aug 07 2023 zhoushuiqing <zhoushuiqing2@huawei.com> - 1.9.8p2-14
|
||||
- Backport patche from upstream community
|
||||
|
||||
* Tue Jun 13 2023 zhoushuiqing <zhoushuiqing2@huawei.com> - 1.9.8p2-13
|
||||
- Backport patches from upstream community
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user