summary refs log tree commit diff
path: root/iconv
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2015-02-25 15:41:31 -0800
committerRoland McGrath <roland@hack.frob.com>2015-02-25 15:41:31 -0800
commitd19df6ac5ace81ca8412f8bf160ae63f44f6f0cf (patch)
treef1c6308464a5c926b8e03e83c6641e693bb645c0 /iconv
parentd68eba500ca0347364b4c428c51fb607c9278f07 (diff)
downloadglibc-d19df6ac5ace81ca8412f8bf160ae63f44f6f0cf.tar.gz
glibc-d19df6ac5ace81ca8412f8bf160ae63f44f6f0cf.tar.xz
glibc-d19df6ac5ace81ca8412f8bf160ae63f44f6f0cf.zip
Don't crash in iconv setup when getcwd fails.
Diffstat (limited to 'iconv')
-rw-r--r--iconv/gconv_conf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c
index ee5e6e499c..0ba4739c41 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] == '/');