Re: [PATCH] lib/autoconf/c.m4: fix NULL pointer dereference in _AC_LANG_IO_PROGRAM

2021-06-28 Thread Zack Weinberg
On Mon, Jun 28, 2021 at 10:17 AM Nicolas Iooss wrote: > * lib/autoconf/c.m4: return an error when f is NULL. > --- > lib/autoconf/c.m4 | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 > index 9f881f0bc10c..0d9efa62d450 100644 > ---

[PATCH] lib/autoconf/c.m4: fix NULL pointer dereference in _AC_LANG_IO_PROGRAM

2021-06-28 Thread Nicolas Iooss
The following program crashes (with a segmentation fault) when fopen fails: #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; } This is due to ferror dereferencing a NULL pointer (using GNU C Library 2.33). *