libsepol: avoid implicit conversions
Avoid implicit conversions from signed to unsigned values, found by UB sanitizers, by using unsigned values in the first place. util.c:95:15: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
parent
92cc1b0e85
commit
12e9846205
|
@ -92,7 +92,7 @@ char *sepol_av_to_string(policydb_t * policydbp, uint32_t tclass,
|
|||
cladatum = policydbp->class_val_to_struct[tclass - 1];
|
||||
p = avbuf;
|
||||
for (i = 0; i < cladatum->permissions.nprim; i++) {
|
||||
if (av & (1 << i)) {
|
||||
if (av & (UINT32_C(1) << i)) {
|
||||
v.val = i + 1;
|
||||
rc = hashtab_map(cladatum->permissions.table,
|
||||
perm_name, &v);
|
||||
|
|
Loading…
Reference in New Issue