From 335770ac08648d57ca6d1b9b1ca0fb7047ae8e42 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Mon, 21 Sep 2020 19:03:17 +0000 Subject: [PATCH] mkcsmapper: Fix UBSan signed shift error usr.bin/mkcsmapper/yacc.y:466:18: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' --- usr.bin/mkcsmapper/yacc.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/mkcsmapper/yacc.y b/usr.bin/mkcsmapper/yacc.y index fc43ea80da0f..8d67be70beec 100644 --- a/usr.bin/mkcsmapper/yacc.y +++ b/usr.bin/mkcsmapper/yacc.y @@ -463,7 +463,7 @@ set_src_zone(u_int32_t val) default: goto bad; } - rowcol_mask = 1 << (rowcol_bits - 1); + rowcol_mask = 1u << (rowcol_bits - 1); rowcol_mask |= rowcol_mask - 1; for (i = 0; i < rowcol_len; ++i) { p = &rowcol[i];