summaryrefslogtreecommitdiff
path: root/graphics/sane-backends/patches
diff options
context:
space:
mode:
authormartin <martin@pkgsrc.org>2016-03-15 09:14:03 +0000
committermartin <martin@pkgsrc.org>2016-03-15 09:14:03 +0000
commit612ab9fd4c971b124fd94a91bd5b11f09fdaaee6 (patch)
treeef6c38397ba4f92611ad402c7d4a80291f3fddad /graphics/sane-backends/patches
parent66efb946925e97f0adeaf0e6ae6ce44612df4a9c (diff)
downloadpkgsrc-612ab9fd4c971b124fd94a91bd5b11f09fdaaee6.tar.gz
Fix usb bulk reads on big endian 64bit platforms.
Closes PR pkg/50340.
Diffstat (limited to 'graphics/sane-backends/patches')
-rw-r--r--graphics/sane-backends/patches/patch-sanei_sanei_usb.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/graphics/sane-backends/patches/patch-sanei_sanei_usb.c b/graphics/sane-backends/patches/patch-sanei_sanei_usb.c
new file mode 100644
index 00000000000..1099d63a4bb
--- /dev/null
+++ b/graphics/sane-backends/patches/patch-sanei_sanei_usb.c
@@ -0,0 +1,35 @@
+$NetBSD: patch-sanei_sanei_usb.c,v 1.1 2016/03/15 09:14:03 martin Exp $
+
+Avoid storing an int (the number of bytes transfered) in the wrong
+half of a ssize_t on big endian 64bit platforms.
+
+Reported upstream as:
+https://alioth.debian.org/tracker/index.php?func=detail&aid=315337
+
+
+--- sanei/sanei_usb.c.orig 2014-12-16 14:37:26.000000000 +0100
++++ sanei/sanei_usb.c 2016-03-15 09:12:34.335049822 +0100
+@@ -2310,10 +2310,10 @@ sanei_usb_read_bulk (SANE_Int dn, SANE_B
+ {
+ if (devices[dn].bulk_in_ep)
+ {
+- int ret;
++ int ret, rsize;
+ ret = libusb_bulk_transfer (devices[dn].lu_handle,
+ devices[dn].bulk_in_ep, buffer,
+- (int) *size, (int *) &read_size,
++ (int) *size, &rsize,
+ libusb_timeout);
+
+ if (ret < 0)
+@@ -2323,6 +2323,10 @@ sanei_usb_read_bulk (SANE_Int dn, SANE_B
+
+ read_size = -1;
+ }
++ else
++ {
++ read_size = rsize;
++ }
+ }
+ else
+ {