mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-05 04:59:42 +00:00
libsepol: avoid potential NULL dereference on optional parameter
The parameter `reason` of `context_struct_compute_av()` is optional and can be passed in as NULL, like from `type_attribute_bounds_av()`. Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
parent
956bda08f6
commit
f505a73b06
@ -894,7 +894,8 @@ static void type_attribute_bounds_av(context_struct_t *scontext,
|
|||||||
/* mask violated permissions */
|
/* mask violated permissions */
|
||||||
avd->allowed &= ~masked;
|
avd->allowed &= ~masked;
|
||||||
|
|
||||||
*reason |= SEPOL_COMPUTEAV_BOUNDS;
|
if (reason)
|
||||||
|
*reason |= SEPOL_COMPUTEAV_BOUNDS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user