diff options
author | Michael Brown <mcb30@ipxe.org> | 2020-06-19 17:29:46 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2020-06-19 17:33:27 +0100 |
commit | 8830f2f3514751e702199600fa6d0c42522a709a (patch) | |
tree | 9f7e182a487bdf7e299172cb2e7d0d9c4fe44ab3 /src/core | |
parent | 2000297011172a9f04be41aca76411bde2c54a76 (diff) | |
download | ipxe-8830f2f3514751e702199600fa6d0c42522a709a.tar.gz |
[parseopt] Treat empty integer strings in user input as invalid
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/parseopt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/parseopt.c b/src/core/parseopt.c index 3ddf94f3d..007080088 100644 --- a/src/core/parseopt.c +++ b/src/core/parseopt.c @@ -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; } |