fmdump -O uses unchecked strtoull
cmd - userland programs
-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
strtoxxin 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
-Oshouldn'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.