mirror of
https://github.com/SELinuxProject/selinux
synced 2025-02-21 20:16:51 +00:00
libsepol: use correct error type to please UBSAN
The callback function apply in hashtap_map has a return type of int and can return -1 on error. Use int as type to save the return value to avoid implicit conversions: hashtab.c:236:10: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned) Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
parent
2d08c5dd89
commit
496002e7ea
@ -224,8 +224,9 @@ int hashtab_map(hashtab_t h,
|
||||
int (*apply) (hashtab_key_t k,
|
||||
hashtab_datum_t d, void *args), void *args)
|
||||
{
|
||||
unsigned int i, ret;
|
||||
unsigned int i;
|
||||
hashtab_ptr_t cur;
|
||||
int ret;
|
||||
|
||||
if (!h)
|
||||
return SEPOL_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user