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

54012: fix use of out of scope array variable

This commit is contained in:
Oliver Kiddle 2025-10-31 10:38:50 +01:00
parent 6ac61e9a8f
commit ebd51de38c
2 changed files with 4 additions and 1 deletions

View file

@ -1,5 +1,7 @@
2025-10-31 Oliver Kiddle <opk@zsh.org>
* 54012: Src/subst.c: fix use of out of scope array variable
* 54007: Src/exec.c, Src/hist.c, Src/init.c, Src/jobs.c, Src/module.c,
Src/params.c, Src/signals.c, Src/Zle/complete.c, Src/Zle/zle_misc.c,
Src/Zle/compresult.c, Src/Zle/zle_keymap.c, Src/Zle/zle_main.c:

View file

@ -1626,6 +1626,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
int *ret_flags)
{
char *aptr = *str, c, cc;
char *arr[2];
char *s = aptr, *fstr, *idbeg, *idend, *ostr = (char *) getdata(n);
int colf; /* != 0 means we found a colon after the name */
/*
@ -3266,7 +3267,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
}
if (arrasg) {
/* This is an array assignment. */
char *arr[2], **t, **a, **p;
char **t, **a, **p;
if (spsep || spbreak) {
aval = sepsplit(val, spsep, 0, 1);
isarr = nojoin ? 1 : 2;