mirror of
https://github.com/SELinuxProject/selinux
synced 2025-03-01 07:50:38 +00:00
libselinux: asprintf return code must be checked
Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
ac6ab3afc0
commit
2ca19f3f67
@ -47,7 +47,8 @@ static char *selabel_sub(struct selabel_sub *ptr, const char *src)
|
||||
if (strncmp(src, ptr->src, ptr->slen) == 0 ) {
|
||||
if (src[ptr->slen] == '/' ||
|
||||
src[ptr->slen] == 0) {
|
||||
asprintf(&dst, "%s%s", ptr->dst, &src[ptr->slen]);
|
||||
if (asprintf(&dst, "%s%s", ptr->dst, &src[ptr->slen]) < 0)
|
||||
return NULL;
|
||||
return dst;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user