From 451f11993580c3fb0b80da62885a00f8ee265304 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Mon, 15 Dec 2014 09:10:41 +0100 Subject: [PATCH] server.c (server_setup): Check return value of getcwd and in case of error set buff[0] to 0. * server.c (server_setup): Check return value of getcwd and in case of error set buff[0] to 0. From-SVN: r218732 --- fixincludes/ChangeLog | 5 +++++ fixincludes/server.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index 54945b50a89..571b6d17f60 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,8 @@ +2014-12-15 Uros Bizjak + + * server.c (server_setup): Check return value of + getcwd and in case of error set buff[0] to 0. + 2014-10-21 Uros Bizjak * inclhack.def (glibc_c99_inline_4): Add pthread.h to files. diff --git a/fixincludes/server.c b/fixincludes/server.c index 1e50efc9faa..f1b93a0c388 100644 --- a/fixincludes/server.c +++ b/fixincludes/server.c @@ -192,7 +192,8 @@ server_setup (void) fputs ("trap : 1\n", server_pair.pf_write); fflush (server_pair.pf_write); - getcwd (buff, MAXPATHLEN + 1); + if (getcwd (buff, MAXPATHLEN + 1) == NULL) + buff[0] = 0; p_cur_dir = xstrdup (buff); } -- 2.30.2