diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2019-01-04 03:13:24 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2019-01-04 03:13:24 +0000 |
commit | 253b638eabd53fe4a1f26dbffbc7387180cbdaa0 (patch) | |
tree | 3b14f37e2dc33659a9f84c99d12c59280605a5e0 /lib/libc/stdlib/getopt_long.c | |
parent | 07372194c3016882494a28a8a1ae00472ce31e69 (diff) |
Notes
Diffstat (limited to 'lib/libc/stdlib/getopt_long.c')
-rw-r--r-- | lib/libc/stdlib/getopt_long.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc/stdlib/getopt_long.c b/lib/libc/stdlib/getopt_long.c index 9534a2aff67e..4d92fd0cd45d 100644 --- a/lib/libc/stdlib/getopt_long.c +++ b/lib/libc/stdlib/getopt_long.c @@ -481,6 +481,8 @@ start: #endif if (*place == '-') { place++; /* --foo long option */ + if (*place == '\0') + return (BADARG); /* malformed option */ #ifdef GNU_COMPATIBLE dash_prefix = DD_PREFIX; #endif |