Mercurial > hg > octave-lojdl > gnulib-hg
changeset 15540:eff2fc71e9c1
freopen: Don't crash if the filename argument is NULL.
* lib/freopen.c (rpl_freopen): Don't compare the filename if it is
NULL.
author | Claudio Bley <claudio.bley@gmail.com> |
---|---|
date | Wed, 31 Aug 2011 10:12:25 +0200 |
parents | 4a8142321d8c |
children | 38e51177f2b2 |
files | ChangeLog lib/freopen.c |
diffstat | 2 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-08-31 Claudio Bley <claudio.bley@gmail.com> (tiny change) + + freopen: Don't crash if the filename argument is NULL. + * lib/freopen.c (rpl_freopen): Don't compare the filename if it is + NULL. + 2011-08-30 Paul Eggert <eggert@cs.ucla.edu> openat: work around AIX 7.1 fstatat bug
--- a/lib/freopen.c +++ b/lib/freopen.c @@ -41,7 +41,7 @@ rpl_freopen (const char *filename, const char *mode, FILE *stream) { #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ - if (strcmp (filename, "/dev/null") == 0) + if (filename != NULL && strcmp (filename, "/dev/null") == 0) filename = "NUL"; #endif