Merge pull request #83435 from liggitt/automated-cherry-pick-of-#83261-upstream-release-1.14

[1.14] Automated cherry pick of #83261: bump gopkg.in/yaml.v2 v2.2.4

Kubernetes-commit: bdc7ad2ca2d8f54b59ca076981535b769627834d
This commit is contained in:
Kubernetes Publisher
2019-10-04 00:49:56 -07:00
parent 6cd74d586b
commit 02bcf064a9
47 changed files with 896 additions and 571 deletions
+11 -6
View File
@@ -30,14 +30,19 @@ limitations under the License.
*/
package runtime
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import (
fmt "fmt"
import strings "strings"
import reflect "reflect"
proto "github.com/gogo/protobuf/proto"
import io "io"
math "math"
strings "strings"
reflect "reflect"
io "io"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
+7 -3
View File
@@ -27,9 +27,13 @@ It has these top-level messages:
*/
package schema
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
+20
View File
@@ -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
}
}