Skip to content

Commit bbea41a

Browse files
committed
Do not treat empty boot id argument as 0
Signed-off-by: Dmytro Bagrii <dimich.dmb@gmail.com>
1 parent 269bf7d commit bbea41a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/efibootmgr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,7 +1596,7 @@ parse_opts(int argc, char **argv)
15961596
errno = 0;
15971597
result = strtoul(optarg, &endptr, 16);
15981598
if ((result == ULONG_MAX && errno == ERANGE) ||
1599-
(*endptr != '\0')) {
1599+
(*endptr != '\0') || (*optarg == '\0')) {
16001600
print_error_arrow(optarg, endptr - optarg,
16011601
"Invalid bootnum value");
16021602
conditional_error_reporter(opts.verbose >= 1,
@@ -1736,7 +1736,7 @@ parse_opts(int argc, char **argv)
17361736
errno = 0;
17371737
result = strtoul(optarg, &endptr, 16);
17381738
if ((result == ULONG_MAX && errno == ERANGE) ||
1739-
(*endptr != '\0')) {
1739+
(*endptr != '\0') || (*optarg == '\0')) {
17401740
print_error_arrow(optarg, endptr - optarg,
17411741
"Invalid BootNext value");
17421742
conditional_error_reporter(opts.verbose >= 1,

0 commit comments

Comments
 (0)