]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Don't crash in iconv setup when getcwd fails.
authorRoland McGrath <roland@hack.frob.com>
Wed, 25 Feb 2015 23:41:31 +0000 (15:41 -0800)
committerRoland McGrath <roland@hack.frob.com>
Wed, 25 Feb 2015 23:41:31 +0000 (15:41 -0800)
ChangeLog
iconv/gconv_conf.c

index bf23bc139c0d6c671b6dcf142ada373020ca8234..d35a29b926a03923349474f29901e632c083952c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index ee5e6e499c305b30923478b6b4dd2728b2b4fbf4..0ba4739c410baed08f2261e78df99b81d61e8638 100644 (file)
@@ -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] == '/');