Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: crash with nameref and local argv
- X-seq: zsh-workers 54032
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Oliver Kiddle <opk@xxxxxxx>
- Cc: Mikael Magnusson <mikachu@xxxxxxxxx>, zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: crash with nameref and local argv
- Date: Tue, 4 Nov 2025 14:33:01 -0800
- Archived-at: <https://zsh.org/workers/54032>
- In-reply-to: <7492-1762293031.613359@82wC.JuHX.VKAg>
- List-id: <zsh-workers.zsh.org>
- References: <CAHYJk3Qe7XuGv_B8nFUdHLD4C_kSgaJkS5acAFWTJ2Db_GWoUQ@mail.gmail.com> <CAHYJk3RW-a5_sG4sc4pN-X3=Q1AQ2rZbBsKidWXEBzJps8piZw@mail.gmail.com> <CAH+w=7YuE2GzH1F9r9Q6WmJxk1puj1M1qmSLsQ76pJ2r+49r4g@mail.gmail.com> <CAH+w=7YWh4nS__qzBEb3i9_OYfTkYfqLYSigEp+Obyp6_K+nDg@mail.gmail.com> <4143-1762289686.575274@LOsr.E3jP.C0e7> <CAH+w=7YHz6Wc5DeXvPP9z_ooH63WNpvHSioZYeDJYWbrC1XEDg@mail.gmail.com> <CAH+w=7Y_zy1-1Mx1T4mmUX00UwO-R+FJQGTZ7fOq8DmtJPcvpA@mail.gmail.com> <7492-1762293031.613359@82wC.JuHX.VKAg>
On Tue, Nov 4, 2025 at 1:50 PM Oliver Kiddle <opk@xxxxxxx> wrote:
>
> Adding a check for whether val[4] is NULL or '[' may be enough, or?
There's some other inconsistency in validate_refname() that I have
just noticed. For example, it begins by rejecting all parameters
beginning with a digit, but then later checks would allow a reference
to the special parameter $0 if things got that far.
> Is there definitely no other variables with similar properties to argv?
> ARGC immediately comes to mind.
Yes, ARGC also needs this treatment, although there are fewer failure
cases because it's read-only.
> Or the various automatically local
> completion/zle widget variables. I've tested those and don't see
> problems.
Because those are all in modules, they can't push themselves onto the
doshfunc() stack like argv/ARGC, they're just in the parameter table
where the whole named reference implementation lives.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author