-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retention Count
config uint64
overflow
#755
Comments
Note that it's not that $ go run ./cmd/icingadb --config <(echo 'retention: {count: -1}')
can't parse YAML file /proc/self/fd/11: cannot unmarshal -1 into Go value of type uint64 ( overflow )
exit status 1
$ go run ./cmd/icingadb --config <(echo 'retention: {count: "str"}')
can't parse YAML file /proc/self/fd/11: [1:20] cannot unmarshal string into Go struct field Config.Retention of type uint64
> 1 | retention: {count: "str"}
^
exit status 1 Using a signed int could be a workaround to provide a more helpful error message, at least in some more common error cases (something like trying -1 to disable something). |
This issue is not restricted to the
A quick fix could be to change the type to |
This would be a quick fix addressing this goccy/go-yaml#470. |
Describe the bug
The
config.Retention.Count
is user configurable via the YAML file and thus should not be of typeuint64
, otherwise it can easily be overflowed.The text was updated successfully, but these errors were encountered: