Decoder: flag invalid carriage returns in literal strings (#673)

This commit is contained in:
Cameron Moore
2021-11-23 21:41:59 -06:00
committed by GitHub
parent 64fe47161f
commit 8645d6376b
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ func scanLiteralString(b []byte) ([]byte, []byte, error) {
switch b[i] {
case '\'':
return b[:i+1], b[i+1:], nil
case '\n':
case '\n', '\r':
return nil, nil, newDecodeError(b[i:i+1], "literal strings cannot have new lines")
}
size := utf8ValidNext(b[i:])