Skip to content

Commit 5df7e97

Browse files
committed
fix: judge escape string wrong
1 parent 405ebed commit 5df7e97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

conv/j2t/impl_fallback.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func (self *BinaryConv) doRecurse(ctx context.Context, s string, jp int, desc *t
190190
ret = jp
191191

192192
var key string
193-
if v.Ep >= int64(ret) {
193+
if v.Ep >= 0 && v.Ep < int64(ret) {
194194
key, err = strconv.Unquote(s[v.Iv-1 : ret])
195195
if err != nil {
196196
return
@@ -271,7 +271,7 @@ func (self *BinaryConv) doRecurse(ctx context.Context, s string, jp int, desc *t
271271
ret = jp
272272

273273
var key string
274-
if v.Ep >= int64(ret) {
274+
if v.Ep >= 0 && v.Ep < int64(ret) {
275275
key, err = strconv.Unquote(s[v.Iv-1 : ret])
276276
if err != nil {
277277
return

0 commit comments

Comments
 (0)