]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
When piecing together the file name of a vgdb FIFO do not allow
authorFlorian Krohm <florian@eich-krohm.de>
Fri, 12 Sep 2014 19:52:32 +0000 (19:52 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Fri, 12 Sep 2014 19:52:32 +0000 (19:52 +0000)
user names and host names containing '/' characters.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14526

coregrind/m_gdbserver/remote-utils.c
coregrind/vgdb.c

index aa2cd4ae06e82f552a307c75029f134855c8b57d..1b9ce76bc6cae14c10ac222202a7a7d735e69254 100644 (file)
@@ -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;
 
index d330cb5d84cb1d43d6b32b44df442473573d6965..160e6eebabd0fc4ab8ca9631da73eeffd25bc5ba 100644 (file)
@@ -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);