hplip/hplip-segfault.patch
2009-07-27 17:50:50 +00:00

36 lines
1.7 KiB
Diff

diff -up hplip-3.9.6b/prnt/hpijs/hpcups.cpp.segfault hplip-3.9.6b/prnt/hpijs/hpcups.cpp
--- hplip-3.9.6b/prnt/hpijs/hpcups.cpp.segfault 2009-06-25 20:04:19.000000000 +0100
+++ hplip-3.9.6b/prnt/hpijs/hpcups.cpp 2009-07-27 18:42:04.561544716 +0100
@@ -373,9 +373,12 @@ int HPCups::initContext (char **argv)
if (err == PLUGIN_LIBRARY_MISSING)
{
// call dbus here
- SendDbusMessage (getenv ("DEVICE_URI"), getenv ("PRINTER"),
- EVENT_PRINT_FAILED_MISSING_PLUGIN,
- argv[2], atoi (argv[1]), argv[3]);
+ const char *device_uri = getenv ("DEVICE_URI");
+ const char *printer = getenv ("PRINTER");
+ if (device_uri && printer)
+ SendDbusMessage (device_uri, printer,
+ EVENT_PRINT_FAILED_MISSING_PLUGIN,
+ argv[2], atoi (argv[1]), argv[3]);
BUG ("ERROR: unable to set device = %s, err = %d\n", attr->value, err);
return 1;
}
diff -up hplip-3.9.6b/prnt/hpijs/hpijs.cpp.segfault hplip-3.9.6b/prnt/hpijs/hpijs.cpp
--- hplip-3.9.6b/prnt/hpijs/hpijs.cpp.segfault 2009-06-25 20:04:19.000000000 +0100
+++ hplip-3.9.6b/prnt/hpijs/hpijs.cpp 2009-07-27 18:39:46.755417388 +0100
@@ -253,8 +253,11 @@ int hpijs_set_cb (void *set_cb_data, Ijs
// call dbus here
const char *user_name = " ";
const char *title = " ";
+ char *device_uri = getenv ("DEVICE_URI");
+ char *printer = getenv ("PRINTER");
int job_id = 0;
- SendDbusMessage (getenv ("DEVICE_URI"), getenv("PRINTER"),
+ SendDbusMessage (device_uri ? device_uri : "",
+ printer ? printer : "",
EVENT_PRINT_FAILED_MISSING_PLUGIN,
user_name, job_id, title);
BUG("unable to set device=%s, err=%d\n", svalue, r);