From c7c582a0ef24e9cd51c91cb61a93f6f95624106d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Tue, 14 Sep 2021 14:48:25 +0200 Subject: [PATCH] checkpolicy: avoid implicit conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid implicit conversions from signed to unsigned values, found by UB sanitizers, by using unsigned values in the first place. dismod.c:92:42: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Signed-off-by: Christian Göttsche --- checkpolicy/test/dismod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkpolicy/test/dismod.c b/checkpolicy/test/dismod.c index 1ff161da..ec2a3e9a 100644 --- a/checkpolicy/test/dismod.c +++ b/checkpolicy/test/dismod.c @@ -89,7 +89,7 @@ static void render_access_bitmap(ebitmap_t * map, uint32_t class, fprintf(fp, "{"); for (i = ebitmap_startbit(map); i < ebitmap_length(map); i++) { if (ebitmap_get_bit(map, i)) { - perm = sepol_av_to_string(p, class, 1 << i); + perm = sepol_av_to_string(p, class, UINT32_C(1) << i); if (perm) fprintf(fp, " %s", perm); }