diff --git a/internal/types_stun.go b/internal/types_stun.go index 9550b4e5..8890a1dc 100644 --- a/internal/types_stun.go +++ b/internal/types_stun.go @@ -1,6 +1,7 @@ package internal import ( + "bytes" "encoding/binary" "fmt" @@ -316,7 +317,7 @@ func ParseError(buf []byte) Error { errorText := buf[4:] return Error{ ErrorCode: ErrorCode(errorCode), - ErrorText: string(errorText), + ErrorText: string(bytes.Trim(errorText, "\x00")), } }