[apparmor] [patch 07/24] fix failure paths around policy that can result in a crash

john.johansen at canonical.com john.johansen at canonical.com
Fri Mar 7 17:31:28 UTC 2014


Signed-off-by: John Johansen <john.johansen at canonical.com>

---
 parser/parser_regex.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- 2.9-test.orig/parser/parser_regex.c
+++ 2.9-test/parser/parser_regex.c
@@ -712,6 +712,9 @@
 		prof->policy.rules = NULL;
 		if (!prof->policy.dfa)
 			goto out;
+	} else {
+		aare_delete_ruleset(prof->policy.rules);
+		prof->policy.rules = NULL;
 	}
 
 	aare_reset_matchflags();
@@ -719,6 +722,9 @@
 	error = 0;
 
 out:
+	aare_delete_ruleset(prof->policy.rules);
+	prof->policy.rules = NULL;
+
 	return error;
 }
 




More information about the AppArmor mailing list