libefi: efipart_hdinfo_add_filepath should check strtol result
Use errno for error checking.
This commit is contained in:
parent
abf054b4c6
commit
f43a98e6c2
@ -489,7 +489,14 @@ efipart_hdinfo_add_filepath(EFI_HANDLE disk_handle)
|
||||
return (0);
|
||||
}
|
||||
p++; /* skip the colon */
|
||||
errno = 0;
|
||||
unit = (int)strtol(p, NULL, 0);
|
||||
if (errno != 0) {
|
||||
printf("Bad unit number for partition \"%s\"\n", pathname);
|
||||
free(pathname);
|
||||
free(pd);
|
||||
return (EUNIT);
|
||||
}
|
||||
|
||||
/*
|
||||
* We should have disk registered, if not, we are receiving
|
||||
|
Loading…
x
Reference in New Issue
Block a user