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'
This commit is contained in:
arichardson 2020-09-21 19:03:17 +00:00
parent d3a76c3824
commit 5433404b05

View File

@ -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];