|
From: <sv...@va...> - 2014-09-12 19:52:41
|
Author: florian
Date: Fri Sep 12 19:52:32 2014
New Revision: 14526
Log:
When piecing together the file name of a vgdb FIFO do not allow
user names and host names containing '/' characters.
Modified:
trunk/coregrind/m_gdbserver/remote-utils.c
trunk/coregrind/vgdb.c
Modified: trunk/coregrind/m_gdbserver/remote-utils.c
==============================================================================
--- trunk/coregrind/m_gdbserver/remote-utils.c (original)
+++ trunk/coregrind/m_gdbserver/remote-utils.c Fri Sep 12 19:52:32 2014
@@ -323,10 +323,12 @@
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;
Modified: trunk/coregrind/vgdb.c
==============================================================================
--- trunk/coregrind/vgdb.c (original)
+++ trunk/coregrind/vgdb.c Fri Sep 12 19:52:32 2014
@@ -517,10 +517,12 @@
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);
|