From 2f84fb8c3624d2f86ebe97a76b4e2e202fc388ce Mon Sep 17 00:00:00 2001 From: Hiroshi Yokoi Date: Fri, 16 Oct 2015 16:31:50 +0900 Subject: packet: avoid overflow Signed-off-by: Hiroshi Yokoi --- packet/bgp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packet/bgp.go b/packet/bgp.go index 83d6a713..7b9961ed 100644 --- a/packet/bgp.go +++ b/packet/bgp.go @@ -1458,7 +1458,7 @@ func (esi *EthernetSegmentIdentifier) String() string { s.WriteString(fmt.Sprintf("priority %d", binary.BigEndian.Uint16(esi.Value[6:8]))) case ESI_MAC: s.WriteString(fmt.Sprintf("system mac %s, ", net.HardwareAddr(esi.Value[:6]).String())) - s.WriteString(fmt.Sprintf("local discriminator %d", esi.Value[6]<<16|esi.Value[7]<<8|esi.Value[8])) + s.WriteString(fmt.Sprintf("local discriminator %d", uint32(esi.Value[6])<<16|uint32(esi.Value[7])<<8|uint32(esi.Value[8]))) case ESI_ROUTERID: s.WriteString(fmt.Sprintf("router id %s, ", net.IP(esi.Value[:4]))) s.WriteString(fmt.Sprintf("local discriminator %d", binary.BigEndian.Uint32(esi.Value[4:8]))) -- cgit v1.2.3