From 10bf497cdaa3e6292672c5e1338a386222ad51de Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 4 Feb 2017 04:25:41 +0800 Subject: [PATCH] Critical bug fix! Reset allocated memory This bus has been there for a long time. memset the newly allocated memory to prevent issues. --- sepolicy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sepolicy.c b/sepolicy.c index f7e925357..7a6b8599e 100644 --- a/sepolicy.c +++ b/sepolicy.c @@ -60,6 +60,7 @@ static int add_irule(int s, int t, int c, int p, int effect, int not) { if (av == NULL) { av = cmalloc(sizeof(*av)); + memset(av, 0, sizeof(*av)); av->data |= 1U << (p - 1); int ret = avtab_insert(&policy->te_avtab, &key, av); if (ret) {