Bug #3507
closed
Use of ${service_name} in pipe:// URLs results in crashes and/or inconsistent behavior
Added by Diego Rivera over 9 years ago.
Updated over 9 years ago.
Description
When using ${service_name} in a pipe:// URL, TVH either crashes or behaves erratically. Importantly, it won't even invoke the pipe:// executable.
Run valgrind on top and show the crashes.
Problem has been located in spawn.c:
diff --git a/src/spawn.c b/src/spawn.c
index bb0edea..d5cd9fa 100644
--- a/src/spawn.c
++ b/src/spawn.c
@ -414,7 +414,7
@ spawn_parse_args(char ***argv, int argc, const char *cmd, const char **replace)
strcpy(a, f);
strcat(a, r1);
strcat(a, p + l);
- *argv[i+] = a;
+ (*argv)[i++] = a;
break;
}
}
The issue is an incorrect dereference of argv - assigining to *argv (incorrect) instead of (*argv) (correct). This has been tested and resolves the issue.
Problem has been located in spawn.c:
diff --git a/src/spawn.c b/src/spawn.c
index bb0edea..d5cd9fa 100644
--- a/src/spawn.c
+++ b/src/spawn.c
@@ -414,7 +414,7 @@ spawn_parse_args(char ***argv, int argc, const char *cmd, const char **replace)
strcpy(a, f);
strcat(a, r[1]);
strcat(a, p + l);
- *argv[i++] = a;
+ (*argv)[i++] = a;
break;
}
}
The issue is an incorrect dereference of argv - assigining to *argv (incorrect) instead of (*argv) (correct). This has been tested and resolves the issue.
Pull request #794 submitted with the fix.
- Status changed from New to Fixed
Also available in: Atom
PDF