diff options
Diffstat (limited to 'recipes-security/audit/audit/0001-Remove-strdupa-as-suggested-in-pull-request-25.patch')
-rw-r--r-- | recipes-security/audit/audit/0001-Remove-strdupa-as-suggested-in-pull-request-25.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/recipes-security/audit/audit/0001-Remove-strdupa-as-suggested-in-pull-request-25.patch b/recipes-security/audit/audit/0001-Remove-strdupa-as-suggested-in-pull-request-25.patch new file mode 100644 index 0000000..38029aa --- /dev/null +++ b/recipes-security/audit/audit/0001-Remove-strdupa-as-suggested-in-pull-request-25.patch @@ -0,0 +1,47 @@ +From a1782b58b687b74249dc8b2411a3f646b821ebd6 Mon Sep 17 00:00:00 2001 +From: Steve Grubb <sgrubb@redhat.com> +Date: Thu, 4 Oct 2018 08:45:47 -0400 +Subject: [PATCH] Remove strdupa as suggested in pull request #25 + +--- + src/auditd.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +Origin: https://github.com/linux-audit/audit-userspace/commit/a1782b58b687b74249dc8b2411a3f646b821ebd6 +Applied-Upstream: yes + +diff --git a/src/auditd.c b/src/auditd.c +index b0952db..c826ec0 100644 +--- a/src/auditd.c ++++ b/src/auditd.c +@@ -209,21 +209,22 @@ static void cont_handler(struct ev_loop *loop, struct ev_signal *sig, + + static int extract_type(const char *str) + { +- const char *tptr, *ptr2, *ptr = str; ++ const char *ptr2, *ptr = str; + if (*str == 'n') { + ptr = strchr(str+1, ' '); + if (ptr == NULL) + return -1; // Malformed - bomb out + ptr++; + } ++ + // ptr should be at 't' + ptr2 = strchr(ptr, ' '); +- // get type=xxx in a buffer +- tptr = strndupa(ptr, ptr2 - ptr); ++ + // find = +- str = strchr(tptr, '='); +- if (str == NULL) ++ str = strchr(ptr, '='); ++ if (str == NULL || str >= ptr2) + return -1; // Malformed - bomb out ++ + // name is 1 past + str++; + return audit_name_to_msg_type(str); +-- +2.20.1 + |