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:
Jose Molina 2026-01-19 01:13:47 +01:00 committed by GitHub
parent ef815c59a2
commit 4b2b4af903
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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()