1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-23 16:17:36 +02:00
openwrt-packages/utils/hplip/patches/030-replace_unsafe_memcpy_with_memmove.patch
Rosen Penev da62d7b7a0
hplip: move back to compiling with libusb
Some change in base broke compilation with libusb and this package.
From looking at it more carefully, it turns out that the libusb patch
needs to be updated so that host paths are not used.

libusb-compat also depends on libusb, which increases the overall
installed size.

Refreshed patches with make package/hplip/refresh .

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-11-29 14:43:43 -08:00

16 lines
526 B
Diff

https://bugs.launchpad.net/hplip/+bug/1672256
memcpy should never be used with overlapping memory regions
--- a/io/hpmud/musb.c
+++ b/io/hpmud/musb.c
@@ -775,7 +775,7 @@ static int device_id(int fd, unsigned ch
len = size-1; /* leave byte for zero termination */
if (len > 2)
len -= 2;
- memcpy(buffer, buffer+2, len); /* remove length */
+ memmove(buffer, buffer+2, len); /* remove length */
buffer[len]=0;
DBG("read actual device_id successfully fd=%d len=%d\n", fd, len);