diff --git a/scanner.go b/scanner.go index ab3b5bcc..d0b4886a 100644 --- a/scanner.go +++ b/scanner.go @@ -118,7 +118,9 @@ func scanComment(b []byte) ([]byte, []byte, error) { } if b[i] == 0x0a { return b[:i], b[i:], newDecodeError(b[:i], "comments cannot include the 0x0a LF character") - return b[:i], b[i:], newDecodeError(b[:i], "comments cannot include the 0x0A LF character") + } + if b[i] == 0x00 { + return b[:i], b[i:], newDecodeError(b[:i], "comments cannot include the 0x00 NUL character") } if b[i] == '\n' { return b[:i], b[i:], nil