Skip to content

Commit 00353f9

Browse files
Yugendstevegrubb
authored andcommitted
probably fix #362
1 parent 0a9a97b commit 00353f9

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

auparse/nvlist.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,15 @@ int nvlist_append(nvlist *l, nvnode *node)
6565
alloc_array(l);
6666

6767
if (l->cnt == l->size) {
68-
l->array = realloc(l->array, l->size * sizeof(nvnode) * 2);
69-
memset(l->array + l->size, 0, sizeof(nvnode) * l->size);
70-
l->size = l->size * 2;
68+
nvnode* tmp;
69+
tmp = realloc(l->array, l->size * sizeof(nvnode) * 2);
70+
if (tmp != NULL) {
71+
l->array = tmp;
72+
memset(l->array + l->size, 0, sizeof(nvnode) * l->size);
73+
l->size = l->size * 2;
74+
}
75+
else
76+
return 1;
7177
}
7278

7379
nvnode *newnode = &l->array[l->cnt];

src/auditctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ static int check_rule_mismatch(int lineno, const char *option)
390390
audit_rule_syscallbyname_data(&tmprule, ptr);
391391
ptr = strtok_r(NULL, ",", &saved);
392392
}
393-
if (memcmp(tmprule.mask, rule_new->mask, AUDIT_BITMASK_SIZE))
393+
if (memcmp(tmprule.mask, rule_new->mask, AUDIT_BITMASK_SIZE * sizeof(__u32)))
394394
rc = 1;
395395
free(tmp);
396396

0 commit comments

Comments
 (0)