diff options
author | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2021-02-24 08:27:44 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2021-02-24 08:27:44 +0900 |
commit | 65d094d7f25e7304832b104f429449cbcd22770d (patch) | |
tree | 82d9c0aafdfed875b83dae561bfeb4254c747c0c | |
parent | c1c2e05058ffce220edcb07f68bcd4208949b504 (diff) |
server: fix AdministrativeCommunication message parser
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
-rw-r--r-- | pkg/server/util.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/server/util.go b/pkg/server/util.go index e4abbed0..474d495b 100644 --- a/pkg/server/util.go +++ b/pkg/server/util.go @@ -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:] } |