summaryrefslogtreecommitdiff
path: root/aports/busybox/0013-ash-fix-unsafe-use-of-mempcpy.patch
diff options
context:
space:
mode:
authorPÁLI Gábor János <pali.gabor@gmail.com>2022-06-25 23:04:28 +0200
committerPÁLI Gábor János <pali.gabor@gmail.com>2022-06-25 23:04:28 +0200
commit373d8e3dcb62f76a5c2b3608251529c608b98b1d (patch)
tree9d3c179ffd2b2fbd0aaf5b2c98deba8a241c2b46 /aports/busybox/0013-ash-fix-unsafe-use-of-mempcpy.patch
parent2e6c1798e14737745b36726419863180566d53de (diff)
downloadfreebsd-wifibox-alpine-373d8e3dcb62f76a5c2b3608251529c608b98b1d.zip
Move to Linux 5.15.49 + Alpine 3.16.0.
Diffstat (limited to 'aports/busybox/0013-ash-fix-unsafe-use-of-mempcpy.patch')
-rw-r--r--aports/busybox/0013-ash-fix-unsafe-use-of-mempcpy.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/aports/busybox/0013-ash-fix-unsafe-use-of-mempcpy.patch b/aports/busybox/0013-ash-fix-unsafe-use-of-mempcpy.patch
new file mode 100644
index 0000000..944fd38
--- /dev/null
+++ b/aports/busybox/0013-ash-fix-unsafe-use-of-mempcpy.patch
@@ -0,0 +1,32 @@
+From 7750b5a25a8cf9081b7c248687c876d0068e85bb Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <vda.linux@googlemail.com>
+Date: Tue, 1 Mar 2022 09:56:54 +0100
+Subject: [PATCH] ash: fix unsafe use of mempcpy
+
+function old new delta
+subevalvar 1549 1557 +8
+
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+---
+ shell/ash.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/shell/ash.c b/shell/ash.c
+index 54335c5dd..44ec2eafd 100644
+--- a/shell/ash.c
++++ b/shell/ash.c
+@@ -7191,7 +7191,13 @@ subevalvar(char *start, char *str, int strloc,
+ len = orig_len - pos;
+
+ if (!quotes) {
+- loc = mempcpy(startp, startp + pos, len);
++ /* want: loc = mempcpy(startp, startp + pos, len)
++ * but it does not allow overlapping arguments */
++ loc = startp;
++ while (--len >= 0) {
++ *loc = loc[pos];
++ loc++;
++ }
+ } else {
+ for (vstr = startp; pos != 0; pos--) {
+ if ((unsigned char)*vstr == CTLESC)