mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-20 11:46:44 +00:00
Potential fix for code scanning alert no. 13: Incorrect conversion between integer types
https://docs.google.com/spreadsheets/d/1v32I35FdPevLmUOZteMJ4c3Jl9zSvC3P/edit?usp=drivesdk&ouid=111429212033208144786&rtpof=true&sd=true Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
parent
ef815c59a2
commit
4b2b4af903
1 changed files with 5 additions and 0 deletions
|
|
@ -208,6 +208,11 @@ func (ln *LocalNode) SetFallbackUDP(port int) {
|
|||
ln.mu.Lock()
|
||||
defer ln.mu.Unlock()
|
||||
|
||||
if port < 0 || port > 0xFFFF {
|
||||
log.Warn("Ignoring invalid fallback UDP port", "port", port)
|
||||
return
|
||||
}
|
||||
|
||||
ln.endpoint4.fallbackUDP = uint16(port)
|
||||
ln.endpoint6.fallbackUDP = uint16(port)
|
||||
ln.updateEndpoints()
|
||||
|
|
|
|||
Loading…
Reference in a new issue