mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Remove json-iterator depth patch
This commit is contained in:
parent
e323279ab9
commit
470dfbfc48
@ -140,27 +140,7 @@ func (customNumberDecoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) {
|
|||||||
}
|
}
|
||||||
iter.ReportError("DecodeNumber", err.Error())
|
iter.ReportError("DecodeNumber", err.Error())
|
||||||
default:
|
default:
|
||||||
// init depth, if needed
|
|
||||||
if iter.Attachment == nil {
|
|
||||||
iter.Attachment = int(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
// remember current depth
|
|
||||||
originalAttachment := iter.Attachment
|
|
||||||
|
|
||||||
// increment depth before descending
|
|
||||||
if i, ok := iter.Attachment.(int); ok {
|
|
||||||
iter.Attachment = i + 1
|
|
||||||
if i > 10000 {
|
|
||||||
iter.ReportError("parse", "exceeded max depth")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*(*interface{})(ptr) = iter.Read()
|
*(*interface{})(ptr) = iter.Read()
|
||||||
|
|
||||||
// restore current depth
|
|
||||||
iter.Attachment = originalAttachment
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user