mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Fix some bit-shifting overflow/UB issues reported by Coverity
This commit is contained in:
parent
22e78c3c24
commit
d4cb3c8225
2 changed files with 9 additions and 1 deletions
|
@ -751,7 +751,7 @@ IPAddr SubNetVal::Mask() const {
|
|||
for ( w = subnet_val->Length(); w >= 32; w -= 32 )
|
||||
*(mp++) = 0xffffffff;
|
||||
|
||||
*mp = ~((1 << (32 - w)) - 1);
|
||||
*mp = ~((static_cast<uint32_t>(1) << (32 - w)) - 1);
|
||||
|
||||
while ( ++mp < m + 4 )
|
||||
*mp = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue