I just got the following notice when emerging dev-libs/libmix-2.05 (which is used for example by net-analyzer/netcat): * QA Notice: Package has poor programming practices which may compile * fine but exhibit random runtime failures. * misc/misc.c:212: warning: null argument where non-null required (argument 1) misc/misc.c:212: warning: null argument where non-null required (argument 1) misc/misc.c:212: warning: null argument where non-null required (argument 2) [several repetitions snipped for brevity] Looking into the code, I found that the warning came from the pattern() function, which libmix exports and is badly broken; it's doing a strcmp against a NULL pointer, which means if called, it will crash with a segmentation fault: int pattern(char *data, char **list) { int i = 0; while (strcmp(list[i++], NULL) != 0) if (strstr(data, list[i]) != NULL) return 1; return 0; } The code is not commented, but from the libmix.3 manpage I was able to gather the purpose of the function (it's basically a strstr applied to an array of strings). The header at mix/mix.h states that the array should be terminated with a NULL entry, so the fix was obvious (loop while list[i++] != NULL). I am attaching a patch below, to fix the problem. Reproducible: Always Steps to Reproduce:
Created attachment 129184 [details, diff] fix sigsegv on pattern() ChangeLog entry: 2007-08-25 Israel G. Lugo <israel.lugo@lugosys.com> * misc/misc.c (pattern): Fix breakage caused by derreferencing NULL. I am going to email this upstream as well (to mixter@hacktivismo.com, which is the contact listed on the homepage).
Adding "inclusion" keyword and bumping, over 2 months without a reply since bug report...
Forgot to mention: I sent the patch upstream as well. It was accepted a few days after this bug was submitted, but they said the project "is not under active development". No new version has come out from upstream since, and the code available from http://mixter.void.ru/${P/.}.tgz (libmix-205, SRC_URI for the ebuild) still contains the bug that this patch fixes. All the more reason to include the patch on the ebuild, I would think - please review and commit?
Fixed in libmix-2.05-r1 revision bump.