Project

General

Profile

Actions

Bug #3507

closed

Use of ${service_name} in pipe:// URLs results in crashes and/or inconsistent behavior

Bug #3507: Use of ${service_name} in pipe:// URLs results in crashes and/or inconsistent behavior

Added by Diego Rivera over 10 years ago. Updated over 10 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
IPTV
Target version:
-
Start date:
2016-01-19
Due date:
% Done:

0%

Estimated time:
Found in version:
4.0.8
Affected Versions:

Description

When using ${service_name} in a pipe:// URL, TVH either crashes or behaves erratically. Importantly, it won't even invoke the pipe:// executable.

Updated by Jaroslav Kysela over 10 years ago Actions #1

Run valgrind on top and show the crashes.

Updated by Diego Rivera over 10 years ago Actions #2

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.

Updated by Diego Rivera over 10 years ago Actions #3

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.

Updated by Diego Rivera over 10 years ago Actions #4

Pull request #794 submitted with the fix.

Updated by Jaroslav Kysela over 10 years ago Actions #5

  • Status changed from New to Fixed

Applied. Thanks.

Actions

Also available in: PDF Atom