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
1 changed files with 2 additions and 1 deletions
|
@ -894,7 +894,8 @@ static void type_attribute_bounds_av(context_struct_t *scontext,
|
|||
/* mask violated permissions */
|
||||
avd->allowed &= ~masked;
|
||||
|
||||
*reason |= SEPOL_COMPUTEAV_BOUNDS;
|
||||
if (reason)
|
||||
*reason |= SEPOL_COMPUTEAV_BOUNDS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue