ArgsManager::GetIntArg should error on out-of-bounds value #23843

issue jamesob opened this issue on December 22, 2021
  1. jamesob commented at 7:40 PM on December 22, 2021: member

    Currently, if an out-of-bounds value for the underlying int64_t type is passed to ArgsManager::GetIntArg() (e.g. -maxtipage=9999999999999999), the returned value will silently saturate (similar to the specification of strtoll()). Instead it would be better to detect this out-of-range value and throw an InitError during initialization, explicitly warning the user.

    See also: #23841

    Useful skills:

    Basic C++

    Want to work on this issue?

    For guidance on contributing, please read CONTRIBUTING.md before opening your pull request.

  2. MarcoFalke commented at 8:02 PM on December 22, 2021: member

    See also #17385 (stale)

  3. jamesob commented at 10:01 PM on January 3, 2022: member

    Instead of throwing an error immediately, it would probably be good to print a deprecation message for one release.

  4. vincenzopalazzo commented at 11:42 PM on January 6, 2022: none

    if there is no one that are working on it, I can work on that

  5. luke-jr commented at 2:07 AM on January 12, 2022: member

    Concept NACK. It's a pain to specify max values exactly. It should remain valid to just set =999999999999 and not worry about the specifics.

  6. jamesob commented at 2:24 AM on January 12, 2022: member

    Concept NACK. It's a pain to specify max values exactly. It should remain valid to just set =999999999999 and not worry about the specifics.

    FWIW, I agree. I'll close the issue unless anyone feels differently.

  7. jamesob closed this on Jan 27, 2022

  8. DrahtBot locked this on Jan 27, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-27 21:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me