DockerCLI/cli/compose/types
Sebastiaan van Stijn 0644aa3906
cli/compose/types: UlimitsConfig.MarshalYAML() fix recursion
When marshaling the type with `gopkg.in/yaml.v3`, unmarshaling would
recursively call the type's `MarshalYAML()` function, which ultimately
resulted in a crash:

    runtime: goroutine stack exceeds 1000000000-byte limit
    runtime: sp=0x140202e0430 stack=[0x140202e0000, 0x140402e0000]
    fatal error: stack overflow

This applies a similar fix as was implemented in e7788d6f9a
for the `MarshalJSON()` implementation. An alternative would be to use
a type alias (to remove the `MarshalYAML()`), but keeping it simple.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-11-17 13:17:51 +01:00
..
types.go cli/compose/types: UlimitsConfig.MarshalYAML() fix recursion 2022-11-17 13:17:51 +01:00