freebsd-dev/lib/libc
Kyle Evans 253b638eab getopt_long(3): fix case of malformed long opt
When presented with an arg string like '-l-', getopt_long will successfully
parse out the 'l' short option, then proceed to match '--' against the first
longopts entry as it later does a strncmp with len=0. This latter bit is
arguably another bug in itself, but presumably not a practical issue as all
callers of parse_long_options are already doing the right thing (except this
one pointed out).

An opt string like '-l-' should be considered malformed and throw a bad
argument rather than behaving as if '--' were passed. It cannot possibly do
what the invoker expects, and it's probably the result of a typo (ls -l- a)
rather than any intent.

Reported by:	Tony Overfield <toverfield@yahoo.com>
Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D18616
2019-01-04 03:13:24 +00:00
..
aarch64 Don't export _end on arm64 and riscv. 2018-06-01 23:42:10 +00:00
amd64 Remove MD __sys_* private symbols. 2018-12-05 00:46:09 +00:00
arm Remove MD __sys_* private symbols. 2018-12-05 00:46:09 +00:00
capability Replace dot-dot relative pathing with SRCTOP-relative paths where possible 2017-01-20 03:23:24 +00:00
compat-43 General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
db Remove "All rights reserved" from my files. 2018-05-10 06:41:08 +00:00
gdtoa libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
gen Add man page for dlvsym(3) 2019-01-03 21:31:17 +00:00
gmon mcount: tidy up ANSIfication 2018-10-20 22:39:35 +00:00
i386 Remove MD __sys_* private symbols. 2018-12-05 00:46:09 +00:00
iconv libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
include Bump sys_errlist size to keep ABI backward-compatible for some time. 2018-12-27 13:02:15 +00:00
inet libc: fix cases of undefined behavior. 2018-08-07 15:24:19 +00:00
isc SPDX: more ISC-related files. 2017-12-08 17:52:53 +00:00
locale Fix WITHOUT_ICONV build after r340276. 2018-11-14 09:06:15 +00:00
md Replace dot-dot relative pathing with SRCTOP-relative paths where possible 2017-01-20 03:23:24 +00:00
mips Remove MD __sys_* private symbols. 2018-12-05 00:46:09 +00:00
nameser SPDX: license IDs for some ISC-related files. 2017-12-08 15:57:29 +00:00
net gai_strerror() - Update string error messages according to RFC 3493. 2018-12-23 18:15:48 +00:00
nls Use current locale (f.e. set by thread). It was global locale always 2016-08-24 16:44:27 +00:00
posix1e Move mac.conf to lib/libc/posix1e/ 2018-09-18 01:40:37 +00:00
powerpc Remove MD __sys_* private symbols. 2018-12-05 00:46:09 +00:00
powerpc64 Remove MD __sys_* private symbols. 2018-12-05 00:46:09 +00:00
powerpcspe Fix fabs(3) for powerpcspe, this time for real 2018-07-26 14:42:20 +00:00
quad ANSIfy libc/quad 2018-10-21 00:20:40 +00:00
regex regcomp: revert part of r341838 which turned out to be unrelated 2018-12-19 23:28:56 +00:00
resolv Allow the use of TCP instead of UDP for queries by setting options usevc 2018-08-16 13:18:40 +00:00
riscv Fix setjmp for RISC-V: 2018-07-23 09:54:28 +00:00
rpc Fix CONFS to append the value in this case. 2018-09-18 01:38:44 +00:00
secure Carefully update stack guard bytes inside __guard_setup(). 2018-04-24 15:59:39 +00:00
softfloat Add implementations for clog(3), clogf(3), and clog(3). 2018-05-13 09:54:34 +00:00
sparc64 Remove MD __sys_* private symbols. 2018-12-05 00:46:09 +00:00
stdio Follow up on r331936. gets_s(3) will also fail in the same way that 2018-10-23 14:16:02 +00:00
stdlib getopt_long(3): fix case of malformed long opt 2019-01-04 03:13:24 +00:00
stdtime strptime: make %k and %l specifiers match their description in 2018-11-03 23:37:13 +00:00
string Fix WITHOUT_NLS build after r342551. 2018-12-28 16:08:49 +00:00
sys Remove special case handling for getfhat(fd, NULL, handle). 2018-12-11 02:48:49 +00:00
tests Allow multi-byte thousands separators in strfmon(3) 2018-12-19 22:57:47 +00:00
uuid libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
x86/sys Fix a regression in r321608. 2017-08-13 14:42:23 +00:00
xdr General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
yp libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
libc_nossp.ldscript Add different libc ldscript: the one without libssp -- 2016-10-12 13:19:21 +00:00
libc.ldscript
Makefile disable BIND_NOW in libc, libthr, and rtld 2018-12-03 15:59:46 +00:00
Makefile.depend DIRDEPS_BUILD: Regenerate without local dependencies. 2016-02-24 17:20:11 +00:00
Versions.def Create namespace for the symbols added during 13-CURRENT cycle. 2018-11-12 19:12:14 +00:00