Tighten up the numberic argument processing for parse_opt_type and parse_opt_oem_string to catch more typos.
Signed-off-by: Jerry Hoemann <[email protected]> --- dmiopt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dmiopt.c b/dmiopt.c index 7a9963c..a142698 100644 --- a/dmiopt.c +++ b/dmiopt.c @@ -113,7 +113,7 @@ static u8 *parse_opt_type(u8 *p, const char *arg) char *next; val = strtoul(arg, &next, 0); - if (next == arg) + if (next == arg || (*next != '\0' && *next != ',' && *next != ' ')) { fprintf(stderr, "Invalid type keyword: %s\n", arg); print_opt_type_list(); @@ -228,7 +228,7 @@ static int parse_opt_oem_string(const char *arg) goto done; val = strtoul(arg, &next, 10); - if (next == arg || val == 0x00 || val > 0xff) + if (next == arg || *next != '\0' || val == 0x00 || val > 0xff) { fprintf(stderr, "Invalid OEM string number: %s\n", arg); return -1; -- 2.13.6 _______________________________________________ https://lists.nongnu.org/mailman/listinfo/dmidecode-devel
