aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/hplip/hplip/030-replace_unsafe_memcpy_with_memmove.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-extended/hplip/hplip/030-replace_unsafe_memcpy_with_memmove.patch')
-rw-r--r--meta-oe/recipes-extended/hplip/hplip/030-replace_unsafe_memcpy_with_memmove.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/hplip/hplip/030-replace_unsafe_memcpy_with_memmove.patch b/meta-oe/recipes-extended/hplip/hplip/030-replace_unsafe_memcpy_with_memmove.patch
new file mode 100644
index 0000000000..2babb2b67a
--- /dev/null
+++ b/meta-oe/recipes-extended/hplip/hplip/030-replace_unsafe_memcpy_with_memmove.patch
@@ -0,0 +1,15 @@
+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);
+