2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 06:16:03 +00:00

parser: Fix parser FTBS due to reallocarray

Older glibcs and alternate libcs don't have reallocarray()

So define it if not defined by libc.

Fixes: #3 of https://gitlab.com/apparmor/apparmor/-/issues/109
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/639
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve.beattie@canonical.com>
This commit is contained in:
John Johansen
2020-09-29 11:42:32 -07:00
parent bee9f94eab
commit 709fd0e930
3 changed files with 19 additions and 2 deletions

View File

@@ -52,6 +52,13 @@
#endif
#define NPDEBUG(fmt, args...) /* Do nothing */
#ifndef HAVE_REALLOCARRAY
void *reallocarray(void *ptr, size_t nmemb, size_t size)
{
return realloc(ptr, nmemb * size);
}
#endif
int is_blacklisted(const char *name, const char *path)
{
int retval = _aa_is_blacklisted(name);