1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-27 15:01:00 +01:00

51670: prevent possible underflow in gettext()

This commit is contained in:
Bart Schaefer 2023-04-22 14:40:23 -07:00
parent ba3631b414
commit 858b8de3d7
2 changed files with 5 additions and 1 deletions

View file

@ -335,7 +335,7 @@ getjobtext(Eprog prog, Wordcode c)
tlim = tptr + JOBTEXTSIZE - 1;
tjob = 1;
gettext2(&s);
if (tptr[-1] == Meta)
if (tptr > jbuf && tptr[-1] == Meta)
--tptr;
*tptr = '\0';
freeeprog(prog); /* mark as unused */