From: Florian Krohm Date: Fri, 12 Sep 2014 19:52:32 +0000 (+0000) Subject: When piecing together the file name of a vgdb FIFO do not allow X-Git-Tag: svn/VALGRIND_3_11_0~1006 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92f1abda37773e91ffa6ef7f09ed4c03946f5f82;p=thirdparty%2Fvalgrind.git When piecing together the file name of a vgdb FIFO do not allow user names and host names containing '/' characters. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14526 --- diff --git a/coregrind/m_gdbserver/remote-utils.c b/coregrind/m_gdbserver/remote-utils.c index aa2cd4ae06..1b9ce76bc6 100644 --- a/coregrind/m_gdbserver/remote-utils.c +++ b/coregrind/m_gdbserver/remote-utils.c @@ -323,10 +323,12 @@ void remote_open (const HChar *name) user = VG_(getenv)("LOGNAME"); if (user == NULL) user = VG_(getenv)("USER"); if (user == NULL) user = "???"; + if (VG_(strchr)(user, '/')) user = "???"; host = VG_(getenv)("HOST"); if (host == NULL) host = VG_(getenv)("HOSTNAME"); if (host == NULL) host = "???"; + if (VG_(strchr)(host, '/')) host = "???"; len = strlen(name) + strlen(user) + strlen(host) + 40; diff --git a/coregrind/vgdb.c b/coregrind/vgdb.c index d330cb5d84..160e6eebab 100644 --- a/coregrind/vgdb.c +++ b/coregrind/vgdb.c @@ -517,10 +517,12 @@ void prepare_fifos_and_shared_mem(int pid) user = getenv("LOGNAME"); if (user == NULL) user = getenv("USER"); if (user == NULL) user = "???"; + if (strchr(user, '/')) user = "???"; host = getenv("HOST"); if (host == NULL) host = getenv("HOSTNAME"); if (host == NULL) host = "???"; + if (strchr(host, '/')) host = "???"; len = strlen(vgdb_prefix) + strlen(user) + strlen(host) + 40; from_gdb_to_pid = vmalloc (len);