[klibc] [klibc:update-dash] dash: expand: Fix double-decrement in argstr
klibc-bot for Herbert Xu
herbert at gondor.apana.org.au
Sat Mar 28 14:49:40 PDT 2020
Commit-ID: 4bfffb1572c9d1b77538b5a3e92c27f91bd2ee99
Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=4bfffb1572c9d1b77538b5a3e92c27f91bd2ee99
Author: Herbert Xu <herbert at gondor.apana.org.au>
AuthorDate: Mon, 25 Feb 2019 14:00:31 +0800
Committer: Ben Hutchings <ben at decadent.org.uk>
CommitDate: Sat, 28 Mar 2020 21:42:55 +0000
[klibc] dash: expand: Fix double-decrement in argstr
[ dash commit 86a841bb444ed1d9a09afb38cb818a21c04e1beb ]
Due to a double decrement in argstr we may miss field separators
at the end of a word in certain situations.
Reported-by: Martijn Dekker <martijn at inlv.org>
Fixes: 3cd538634f71 ("expand: Do not reprocess data when...")
Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/dash/expand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr/dash/expand.c b/usr/dash/expand.c
index 20362cef..562a4869 100644
--- a/usr/dash/expand.c
+++ b/usr/dash/expand.c
@@ -285,7 +285,7 @@ start:
q = stnputs(p, length, expdest);
q[-1] &= end - 1;
expdest = q - (flag & EXP_WORD ? end : 0);
- newloc = expdest - (char *)stackblock() - end;
+ newloc = q - (char *)stackblock() - end;
if (breakall && !inquotes && newloc > startloc) {
recordregion(startloc, newloc, 0);
}
More information about the klibc
mailing list