From d19df6ac5ace81ca8412f8bf160ae63f44f6f0cf Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 25 Feb 2015 15:41:31 -0800 Subject: Don't crash in iconv setup when getcwd fails. --- iconv/gconv_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'iconv') 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] == '/'); -- cgit v1.2.3-65-gdbad