f8883a97a0
- Rebase to 1.9.5p2 - CVE-2023-28486 sudo: Sudo does not escape control characters in log messages Resolves: RHEL-21825 - CVE-2023-28487 sudo: Sudo does not escape control characters in sudoreplay output Resolves: RHEL-21831 - CVE-2023-42465 sudo: Targeted Corruption of Register and Stack Variables Resolves: RHEL-21820 Signed-off-by: Radovan Sroka <rsroka@redhat.com>
40 lines
1.2 KiB
Diff
40 lines
1.2 KiB
Diff
From d109cd61d9ff01053f1d43b7d4fc0e5e657c8da3 Mon Sep 17 00:00:00 2001
|
|
From: "Todd C. Miller" <Todd.Miller@sudo.ws>
|
|
Date: Tue, 27 Jul 2021 12:19:53 -0600
|
|
Subject: [PATCH] In new_logline check for NULL args->reason for EVLOG_RAW.
|
|
This can't happen in practice since we never set EVLOG_RAW without passing in
|
|
a reason. Coverity CID 237142 237143
|
|
|
|
---
|
|
lib/eventlog/eventlog.c | 14 ++++++++------
|
|
1 file changed, 8 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/lib/eventlog/eventlog.c b/lib/eventlog/eventlog.c
|
|
index 280be7fcf..26c5f6dc7 100644
|
|
--- a/lib/eventlog/eventlog.c
|
|
+++ b/lib/eventlog/eventlog.c
|
|
@@ -106,12 +106,14 @@ new_logline(int event_type, int flags, struct eventlog_args *args,
|
|
debug_decl(new_logline, SUDO_DEBUG_UTIL);
|
|
|
|
if (ISSET(flags, EVLOG_RAW)) {
|
|
- if (args->errstr != NULL) {
|
|
- if (asprintf(&line, "%s: %s", args->reason, args->errstr) == -1)
|
|
- goto oom;
|
|
- } else {
|
|
- if ((line = strdup(args->reason)) == NULL)
|
|
- goto oom;
|
|
+ if (args->reason != NULL) {
|
|
+ if (args->errstr != NULL) {
|
|
+ if (asprintf(&line, "%s: %s", args->reason, args->errstr) == -1)
|
|
+ goto oom;
|
|
+ } else {
|
|
+ if ((line = strdup(args->reason)) == NULL)
|
|
+ goto oom;
|
|
+ }
|
|
}
|
|
debug_return_str(line);
|
|
}
|
|
--
|
|
2.43.0
|
|
|