[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#542640: hpijs: segfault can't use my HP Deskjet 5940



Hi,

I have corrected the segfault in hpijs :

--- hplip-2.8.6.b-orig/prnt/hpijs/hpijs.cpp	2008-07-23 03:33:17.000000000 +0200
+++ hplip-2.8.6.b/prnt/hpijs/hpijs.cpp	2009-08-21 22:25:07.761506689 +0200
@@ -58,7 +58,7 @@
    if ((n = vsnprintf(buf, 256, fmt, args)) == -1)
       buf[255] = 0;     /* output was truncated */
 
-   fprintf(stderr, buf);
+   fputs(buf, stderr);
    syslog(LOG_WARNING, buf);
 
    fflush(stderr);

The source of the segfault is in hpijs_set_cb() :

320      else
321          bug("unable to set key=%s, value=%s\n", key, svalue);

Where key and svalue are "user" input string from gs. You can see this in
my foomatic-rip log line 103 : "-sOutputFile=%stdout". The %s caused
fprintf to segfault...

Anyway, it fixes the segfault (and a security hole ?), but my printer is
not working...

Best Regards
--
Louis Opter




Reply to: