mirror of
https://github.com/ipxe/ipxe
synced 2025-12-18 18:40:24 +03:00
[parseopt] Treat empty integer strings in user input as invalid
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -93,7 +93,7 @@ int parse_integer ( char *text, unsigned int *value ) {
|
||||
|
||||
/* Parse integer */
|
||||
*value = strtoul ( text, &endp, 0 );
|
||||
if ( *endp ) {
|
||||
if ( *endp || ( ! *text ) ) {
|
||||
printf ( "\"%s\": invalid integer value\n", text );
|
||||
return -EINVAL_INTEGER;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user