diff options
author | Roland McGrath <roland@hack.frob.com> | 2015-02-25 15:41:31 -0800 |
---|---|---|
committer | Roland McGrath <roland@hack.frob.com> | 2015-02-25 15:41:31 -0800 |
commit | d19df6ac5ace81ca8412f8bf160ae63f44f6f0cf (patch) | |
tree | f1c6308464a5c926b8e03e83c6641e693bb645c0 | |
parent | d68eba500ca0347364b4c428c51fb607c9278f07 (diff) | |
download | glibc-d19df6ac5ace81ca8412f8bf160ae63f44f6f0cf.zip glibc-d19df6ac5ace81ca8412f8bf160ae63f44f6f0cf.tar.gz glibc-d19df6ac5ace81ca8412f8bf160ae63f44f6f0cf.tar.bz2 |
Don't crash in iconv setup when getcwd fails.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | iconv/gconv_conf.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2015-02-25 Roland McGrath <roland@hack.frob.com> + + * iconv/gconv_conf.c (__gconv_get_path): Don't crash if __getcwd + returns a null pointer. + 2015-02-25 Adhemerval Zanella <azanella@linux.vnet.ibm.com> * sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c: Define memcpy diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c index ee5e6e4..0ba4739 100644 --- a/iconv/gconv_conf.c +++ b/iconv/gconv_conf.c @@ -468,7 +468,7 @@ __gconv_get_path (void) ":", 1), default_gconv_path, sizeof (default_gconv_path)); cwd = __getcwd (NULL, 0); - cwdlen = strlen (cwd); + cwdlen = __glibc_unlikely (cwd == NULL) ? 0 : strlen (cwd); } assert (default_gconv_path[0] == '/'); |