From 5c8d72771b35de798b11edae1a75e8eccdba5757 Mon Sep 17 00:00:00 2001 From: Matthew Ife Date: Mon, 30 Nov 2020 11:02:05 +0000 Subject: [PATCH] Smaller bugfixes and testing module works as imagined. Signed-off-by: Matthew Ife --- libsepol/src/hashtab.c | 2 +- libsepol/src/write.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libsepol/src/hashtab.c b/libsepol/src/hashtab.c index 76b977a903..ff7ef63fcd 100644 --- a/libsepol/src/hashtab.c +++ b/libsepol/src/hashtab.c @@ -230,7 +230,7 @@ int hashtab_map(hashtab_t h, for (i = 0; i < h->size; i++) { cur = h->htable[i]; - while (curi != NULL) { + while (cur != NULL) { next = cur->next; ret = apply(cur->key, cur->datum, args); if (ret) diff --git a/libsepol/src/write.c b/libsepol/src/write.c index dd418317a3..5f6356b469 100644 --- a/libsepol/src/write.c +++ b/libsepol/src/write.c @@ -2170,7 +2170,7 @@ static void scope_write_destroy(hashtab_key_t key __attribute__ ((unused)), free(cur); } -static void type_attr_filter(hashtab_key_t key, +static int type_attr_filter(hashtab_key_t key, hashtab_datum_t datum, void *args) { type_datum_t *typdatum = datum; @@ -2186,9 +2186,11 @@ static void type_attr_filter(hashtab_key_t key, if (scope) hashtab_remove(scopetbl, key, scope_write_destroy, scope); } + + return 0; } -static void role_attr_filter(hashtab_key_t key, +static int role_attr_filter(hashtab_key_t key, hashtab_datum_t datum, void *args) { role_datum_t *role = datum; @@ -2204,6 +2206,8 @@ static void role_attr_filter(hashtab_key_t key, if (scope) hashtab_remove(scopetbl, key, scope_write_destroy, scope); } + + return 0; } /*