1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Fix crash on long PS1 prompt (Solaris patch 195-17824699)

Original report and info:
https://www.mail-archive.com/ast-developers@lists.research.att.com/msg01677.html
https://www.mail-archive.com/ast-developers@lists.research.att.com/msg01679.html

Patch pulled in from:
https://raw.githubusercontent.com/oracle/solaris-userland/master/components/ksh93/patches/195-17824699.patch

src/cmd/ksh93/edit/edit.c: ed_setup():
- Prevent the ed_setup() function from writing past ep->e_prompt,
  which is set to the local char prompt[PRSIZE] variable in
  ed_emacsread().

src/cmd/ksh93/include/edit.h:
- Increase maximum prompt size, PRSIZE, to 256.
This commit is contained in:
Martijn Dekker 2021-01-08 22:15:48 +00:00
parent 86fc4c6d0a
commit 1de20d65a8
4 changed files with 9 additions and 3 deletions

View file

@ -658,7 +658,8 @@ void ed_setup(register Edit_t *ep, int fd, int reedit)
{
int skip=0;
ep->e_crlf = 0;
*pp++ = c;
if(pp<ppmax)
*pp++ = c;
for(n=1; c = *last++; n++)
{
if(pp < ppmax)