We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2683a94 commit 3f563fcCopy full SHA for 3f563fc
parser/lexer/utils.go
@@ -2,6 +2,7 @@ package lexer
2
3
import (
4
"fmt"
5
+ "math"
6
"strings"
7
"unicode/utf8"
8
)
@@ -31,6 +32,9 @@ func unescape(value string) (string, error) {
31
32
// The string contains escape characters.
33
// The following logic is adapted from `strconv/quote.go`
34
var runeTmp [utf8.UTFMax]byte
35
+ if n >= 2/3*math.MaxInt {
36
+ return "", fmt.Errorf("too large string")
37
+ }
38
buf := make([]byte, 0, 3*n/2)
39
for len(value) > 0 {
40
c, multibyte, rest, err := unescapeChar(value)
0 commit comments