1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-31 06:00:54 +01:00

41078: Empty psvar could cause bad dereference in prompt expansion

This commit is contained in:
Peter Stephenson 2017-05-09 09:46:23 +01:00
parent 51eff6168e
commit 263a0c2476
3 changed files with 10 additions and 1 deletions

View file

@ -399,7 +399,7 @@ putpromptchar(int doprint, int endchar, unsigned int *txtchangep)
test = 1;
break;
case 'V':
if (arrlen_ge(psvar, arg)) {
if (psvar && *psvar && arrlen_ge(psvar, arg)) {
if (*psvar[(arg ? arg : 1) - 1])
test = 1;
}