summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--Src/text.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index ce40f65e0..c8060d55f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2021-09-06 Bart Schaefer <schaefer@zsh.org>
+ * 49266: fix segfault on metacharacters in long job texts
+
* Marlon Richert: 49218: Functions/Misc/run-help,
Functions/Misc/run-help-btrfs, Functions/Misc/run-help-git,
Functions/Misc/run-help-ip, Functions/Misc/run-help-p4,
diff --git a/Src/text.c b/Src/text.c
index 4bf88f2e2..5cd7685fd 100644
--- a/Src/text.c
+++ b/Src/text.c
@@ -335,6 +335,8 @@ getjobtext(Eprog prog, Wordcode c)
tlim = tptr + JOBTEXTSIZE - 1;
tjob = 1;
gettext2(&s);
+ if (tptr[-1] == Meta)
+ --tptr;
*tptr = '\0';
freeeprog(prog); /* mark as unused */
untokenize(jbuf);