Project

General

Profile

Actions

Bug #16052

open

fmdump -O uses unchecked strtoull

Added by Thirteen Oxide 18 days ago. Updated 10 days ago.

Status:
New
Priority:
Low
Category:
cmd - userland programs
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

Related to illumos gate - Bug #16051: fmdump -A, -a, -H, -j, and -p should be documentedNewThirteen Oxide

Actions
Actions #1

Updated by Thirteen Oxide 18 days ago

  • Related to Bug #16051: fmdump -A, -a, -H, -j, and -p should be documented added
Actions #2

Updated by Electric Monk 10 days ago

  • Gerrit CR set to 3150
Actions

Also available in: Atom PDF