mirror of
https://github.com/SELinuxProject/selinux
synced 2025-02-17 18:16:52 +00:00
libsepol: avoid integer overflow in add_i_to_a()
Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
parent
22d3609b13
commit
a55cd37461
@ -44,7 +44,7 @@ int add_i_to_a(uint32_t i, uint32_t * cnt, uint32_t ** a)
|
||||
{
|
||||
uint32_t *new;
|
||||
|
||||
if (cnt == NULL || a == NULL)
|
||||
if (cnt == NULL || *cnt == UINT32_MAX || a == NULL)
|
||||
return -1;
|
||||
|
||||
/* FIX ME: This is not very elegant! We use an array that we
|
||||
|
Loading…
Reference in New Issue
Block a user