File: mayhem_czap.patch

package info (click to toggle)
linuxtv-dvb-apps 1.1.1%2Brev1500-2.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,980 kB
  • sloc: ansic: 49,043; makefile: 810; perl: 236; sh: 110; xml: 13
file content (29 lines) | stat: -rw-r--r-- 766 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Author: Bernhard Übelacker <bernhardu@vr-web.de>
Last-Update: 2013-07-10
Bug-Debian: https://bugs.debian.org/715773
Description: Fix czap crash because of a strlen(0)

--- a/util/szap/czap.c
+++ b/util/szap/czap.c
@@ -314,9 +314,6 @@ int main(int argc, char **argv)
 		return -1;
 	}
 
-	if (!homedir)
-		ERROR("$HOME not set");
-
 	snprintf (FRONTEND_DEV, sizeof(FRONTEND_DEV),
 		  "/dev/dvb/adapter%i/frontend%i", adapter, frontend);
 
@@ -328,8 +325,10 @@ int main(int argc, char **argv)
 	if (!confname)
 	{
 		int len = strlen(homedir) + strlen(CHANNEL_FILE) + 18;
-		if (!homedir)
+		if (!homedir) {
 			ERROR("$HOME not set");
+			return -1;
+		}
 		confname = malloc(len);
 		snprintf(confname, len, "%s/.czap/%i/%s",
 			 homedir, adapter, CHANNEL_FILE);