[MOD] STR #4100: libusb-based USB backend: usblp_attached field of printer data structure can stay uninitialized

Till Kamppeter <[email protected]>
Newsgroups gmane.comp.printing.cups.bugs
Message-ID <[email protected]>
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

If open_device() errors out early, before detaching the usblp kernel
module, close_device() can get called with printer->usblp_attached
uninitialized.

Patch with the fix is attached.

Link: http://www.cups.org/str.php?L4100
Version: 1.5.3

_______________________________________________
cups-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/cups-bugs
usb-backend-initialize-usblp-attached-state.patch (text/plain, 261 B)
--- a/backend/usb-libusb.c
+++ b/backend/usb-libusb.c
@@ -1098,6 +1098,8 @@
   if (libusb_open(printer->device, &printer->handle) < 0)
     return (-1);
 
+  printer->usblp_attached = 0;
+
   if (verbose)
     fputs("STATE: +connecting-to-device\n", stderr);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.