Commit ca7383f
pkg/packet/bgp: fix flowspec parser to check the input length
case EC_SUBTYPE_FLOWSPEC_REDIRECT_IP6:
ipv6 := net.IP(data[2:18]).String()
localAdmin := binary.BigEndian.Uint16(data[18:20])
return NewRedirectIPv6AddressSpecificExtended(ipv6, localAdmin), nil
Note that the `data` length is only checked for being at least 8
bytes, so any message with the given subtype but less than 20 bytes
will crash the application.1 parent 5693c58 commit ca7383f
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12708 | 12708 | | |
12709 | 12709 | | |
12710 | 12710 | | |
| 12711 | + | |
| 12712 | + | |
| 12713 | + | |
| 12714 | + | |
12711 | 12715 | | |
12712 | 12716 | | |
12713 | 12717 | | |
| |||
0 commit comments