diff options
| author | Michael Brown | 2020-06-19 18:29:46 +0200 |
|---|---|---|
| committer | Michael Brown | 2020-06-19 18:33:27 +0200 |
| commit | 8830f2f3514751e702199600fa6d0c42522a709a (patch) | |
| tree | 9f7e182a487bdf7e299172cb2e7d0d9c4fe44ab3 /src | |
| parent | [util] Treat empty integer strings as invalid (diff) | |
| download | ipxe-8830f2f3514751e702199600fa6d0c42522a709a.tar.gz ipxe-8830f2f3514751e702199600fa6d0c42522a709a.tar.xz ipxe-8830f2f3514751e702199600fa6d0c42522a709a.zip | |
[parseopt] Treat empty integer strings in user input as invalid
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
| -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; } |
