about summary refs log tree commit diff
path: root/iconv
diff options
context:
space:
mode:
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] == '/');