From 9e22a6e1e30fdf74b5808f7d20e22eb1a9444f03 Mon Sep 17 00:00:00 2001 From: John Johansen Date: Tue, 16 Mar 2021 03:56:58 -0700 Subject: [PATCH] parser: Fix invalid reference to name in attachment warning The name var is being improperly used in a warning. Not only is it being used after it is freed, it also never had the correct value as the "name" variable contained the value being used as the base attachment. MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/727 Signed-off-by: John Johansen Acked-by: time out (cherry picked from commit 74bc4275a502f8c44047ff3e318c177d948df646) Signed-off-by: John Johansen --- parser/parser_regex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser/parser_regex.c b/parser/parser_regex.c index c59bf8edf..f257ecfb9 100644 --- a/parser/parser_regex.c +++ b/parser/parser_regex.c @@ -523,7 +523,7 @@ static int process_profile_name_xmatch(Profile *prof) } if (prof->xattrs.list) { if (!(features_supports_domain_xattr && kernel_supports_oob)) { - warn_once_xattr(name); + warn_once_xattr(prof->name); free_cond_entry_list(prof->xattrs); goto build; }