]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
Fix segfault when running foomatic-rip by hand and env PRINTER is missing 139/head
authorZdenek Dohnal <zdohnal@redhat.com>
Mon, 12 Aug 2019 13:53:34 +0000 (15:53 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Mon, 12 Aug 2019 13:53:34 +0000 (15:53 +0200)
filter/foomatic-rip/spooler.c

index 7f0cb8eeb9d0834cee50a01db1e1a16a710a581f..50dcbaf3e31e3beb213ea95c12238709f9c82de2 100644 (file)
@@ -94,8 +94,7 @@ void init_cups(list_t *arglist, dstr_t *filelist, jobparams_t *job)
        CUPS puts the print queue name into the PRINTER environment variable
        when calling filters. */
     strncpy(job->printer, getenv("PRINTER"), 256);
-    if (strlen(getenv("PRINTER")) > 255)
-      job->printer[255] = '\0';
+    job->printer[255] = '\0';
 
     free(cups_options);
 }