Skip to content

Commit

Permalink
server: fix AdministrativeCommunication message parser
Browse files Browse the repository at this point in the history
Signed-off-by: FUJITA Tomonori <[email protected]>
  • Loading branch information
fujita committed Feb 23, 2021
1 parent c1c2e05 commit 65d094d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/server/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ func decodeAdministrativeCommunication(data []byte) (string, []byte) {
if communicationLen > bgp.BGP_ERROR_ADMINISTRATIVE_COMMUNICATION_MAX {
communicationLen = bgp.BGP_ERROR_ADMINISTRATIVE_COMMUNICATION_MAX
}
if communicationLen > len(data)+1 {
communicationLen = len(data) + 1
if communicationLen > len(data)-1 {
communicationLen = len(data) - 1
}
return string(data[1 : communicationLen+1]), data[communicationLen+1:]
}
Expand Down

0 comments on commit 65d094d

Please sign in to comment.