diff options
Diffstat (limited to 'pkg/server')
-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:] } |