Skip to content
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

Unvalidated duration input leads to signed integer overflow and confusing error message #508

Open
reidkaufmann opened this issue Apr 27, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@reidkaufmann
Copy link

reidkaufmann commented Apr 27, 2023

This input probably isn’t expected, but I tried it on a whim. Validating inputs is a chore and clearly the REST endpoint is doing it (as expected), but not the CLI which performs an invalid conversion which leads to a confusing response since a negative input was not provided (though it may be out of bounds).

$ influx bucket update -i a0<redacted>54 -r 999999w --http-debug
…
{"retentionRules":[{"everySeconds":-3943159232,"type":"expire"}]}
…
Error: failed to update bucket "a0<redacted>54": 422 Unprocessable Entity: expiration seconds cannot be negative

Enabling debug output seems to indicate that the unchecked input leads to an signed integer overflow.

@reidkaufmann reidkaufmann added the bug Something isn't working label Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant