found 715773 1.1.1+rev1500-1
stop


Hello,
czap crashes because of a strlen(0) because homedir/$HOME is not set.

Minimal statement to reproduce:
        $ env -i czap 1

Following patch exits immediately after the
message, therefore avoids the crash.

Kind regards,
Bernhard



--- czap.c.orig 2015-05-06 20:26:13.000000000 +0200
+++ czap.c      2015-05-06 21:23:04.959532197 +0200
@@ -314,8 +314,10 @@ int main(int argc, char **argv)
                return -1;
        }
 
-       if (!homedir)
+       if (!homedir) {
                ERROR("$HOME not set");
+               return -1;
+       }
 
        snprintf (FRONTEND_DEV, sizeof(FRONTEND_DEV),
                  "/dev/dvb/adapter%i/frontend%i", adapter, frontend);
@@ -328,8 +330,6 @@ int main(int argc, char **argv)
        if (!confname)
        {
                int len = strlen(homedir) + strlen(CHANNEL_FILE) + 18;
-               if (!homedir)
-                       ERROR("$HOME not set");
                confname = malloc(len);
                snprintf(confname, len, "%s/.czap/%i/%s",
                         homedir, adapter, CHANNEL_FILE);


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to