summaryrefslogtreecommitdiff
path: root/vendor/gopkg.in/yaml.v2/decode.go
diff options
context:
space:
mode:
authordependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>2019-10-01 19:22:08 +0000
committerValentin Rothberg <rothberg@redhat.com>2019-10-02 09:14:25 +0200
commit2f6276cd7261420bfb1685a64f5739b3bf7eba54 (patch)
tree72445db50f94bc18200ce1dab35b609eb971de7a /vendor/gopkg.in/yaml.v2/decode.go
parent7a5696316a03df5dddded9c3afa8bf26acd74678 (diff)
downloadpodman-2f6276cd7261420bfb1685a64f5739b3bf7eba54.tar.gz
podman-2f6276cd7261420bfb1685a64f5739b3bf7eba54.tar.bz2
podman-2f6276cd7261420bfb1685a64f5739b3bf7eba54.zip
Bump gopkg.in/yaml.v2 from 2.2.2 to 2.2.3
Bumps [gopkg.in/yaml.v2](https://github.com/go-yaml/yaml) from 2.2.2 to 2.2.3. - [Release notes](https://github.com/go-yaml/yaml/releases) - [Commits](https://github.com/go-yaml/yaml/compare/v2.2.2...v2.2.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Matthew Heon <mheon@redhat.com> Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/gopkg.in/yaml.v2/decode.go')
-rw-r--r--vendor/gopkg.in/yaml.v2/decode.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/gopkg.in/yaml.v2/decode.go b/vendor/gopkg.in/yaml.v2/decode.go
index e4e56e28e..91679b5b4 100644
--- a/vendor/gopkg.in/yaml.v2/decode.go
+++ b/vendor/gopkg.in/yaml.v2/decode.go
@@ -229,6 +229,10 @@ type decoder struct {
mapType reflect.Type
terrors []string
strict bool
+
+ decodeCount int
+ aliasCount int
+ aliasDepth int
}
var (
@@ -315,6 +319,13 @@ func (d *decoder) prepare(n *node, out reflect.Value) (newout reflect.Value, unm
}
func (d *decoder) unmarshal(n *node, out reflect.Value) (good bool) {
+ d.decodeCount++
+ if d.aliasDepth > 0 {
+ d.aliasCount++
+ }
+ if d.aliasCount > 100 && d.decodeCount > 1000 && float64(d.aliasCount)/float64(d.decodeCount) > 0.99 {
+ failf("document contains excessive aliasing")
+ }
switch n.kind {
case documentNode:
return d.document(n, out)
@@ -353,7 +364,9 @@ func (d *decoder) alias(n *node, out reflect.Value) (good bool) {
failf("anchor '%s' value contains itself", n.value)
}
d.aliases[n] = true
+ d.aliasDepth++
good = d.unmarshal(n.alias, out)
+ d.aliasDepth--
delete(d.aliases, n)
return good
}