Bug#366694: libc6: regerror.3 calls abort when given a bad argument
Package: libc6
Version: 2.3.6-7
Severity: normal
The following causes a program to abort():
regerror(ret, NULL, NULL, 0);
AFAIK this is wrong, since regerror() is exported. It should detect
invalid values for "preg" (such as NULL, which could actually be a
compile-time check, __attribute__((not_null)) or whatever), and return
some special value if possible (doh, its a size_t ..) and perhaps set
errno=EINVAL (is this a case of "checking errno is mandatory"?).
#2 0xb7ebd9d8 in *__GI_abort () at ../sysdeps/generic/abort.c:88
#3 0xb7f2cabc in __regerror (errcode=-1208283148, preg=0x0, errbuf=0x0,
errbuf_size=0) at regcomp.c:549
Reply to: