Actions
Bug #16052
openfmdump -O uses unchecked strtoull
Start date:
Due date:
% Done:
0%
Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:
Description
While -O
is undocumented, and probably rightly so, we still shouldn't be doing this:
» » » case 'O': » » » » off = strtoull(optarg, NULL, 16); » » » » iflags |= FMD_LOG_XITER_OFFS; » » » » break;
This makes it very easy to have a subsequent option or argument interpreted as 0 when in fact it wasn't the required numeric option argument at all. Use a checked utility function instead, or check this as we do for other calls to
strtoxx
in the same file. If it's not a number, fail and offer usage help; this won't help all that much given the undocumented nature of the option, but at least that will suggest to the user that -O
shouldn't used unless they know what they're doing, in which case the source code can be consulted to make the nature of the problem obvious.
Related issues
Updated by Thirteen Oxide 18 days ago
- Related to Bug #16051: fmdump -A, -a, -H, -j, and -p should be documented added
Actions