Skip to content

Commit

Permalink
Fix code scanning alert #32: Incorrect conversion between integer types
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
1 parent d73013a commit 8f64898
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libgo/go/net/netip/netip.go
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,9 @@ func PrefixFrom(ip Addr, bits int) Prefix {
if bits < 0 || bits > ip.BitLen() || bits < math.MinInt16 || bits > math.MaxInt16 {
bits = invalidPrefixBits
}
if bits < math.MinInt16 || bits > math.MaxInt16 {
bits = invalidPrefixBits
}
b16 := int16(bits)
return Prefix{
ip: ip.withoutZone(),
Expand Down

0 comments on commit 8f64898

Please sign in to comment.