mirror of
https://github.com/kubernetes/sample-controller.git
synced 2026-04-12 00:00:26 +08:00
Merge pull request #83436 from liggitt/automated-cherry-pick-of-#83261-upstream-release-1.13-1570075716
[1.13] Automated cherry pick of #83261: bump gopkg.in/yaml.v2 v2.2.4 Kubernetes-commit: 17c28f0e1c6733b02a62471c813b262df7681789
This commit is contained in:
+20
@@ -100,7 +100,27 @@ func (customNumberDecoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) {
|
||||
}
|
||||
iter.ReportError("DecodeNumber", err.Error())
|
||||
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()
|
||||
|
||||
// restore current depth
|
||||
iter.Attachment = originalAttachment
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user