Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Zsh parser infinite loop in chuck from utils.c on malformed input
- X-seq: zsh-workers 41084
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx, zsh-workers@xxxxxxx
- Subject: Re: Zsh parser infinite loop in chuck from utils.c on malformed input
- Date: Tue, 9 May 2017 23:43:22 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=jlpM/Hf3R6Uinm8mraTX7XuqAd27NTiQ0l9lTV0frMo=; b=qbtrfFC0UBiKp33jUUhfnBOs3XEHoTWat7VQ2+d1HeTgBP+QH+IMxIRbWxg0WSn022 1/Qj85Bc6NfI54R4xtWPrWk/0u7dpAAVHcnHwssrk4XEAvcFVMFZapS7WlZL64cEkri2 Lxz+Qpx3b+u2Cf4bseggB6G6LR9jZQTkAwYVxzqWEDVvRQdhPxkigCcLe/utmehtTi6S afIf5Y/joMUGpFHOeCJlTbnbtVxeLhTHtIVJdcPkblqsJ7bcTclEvRIIAfOIiCjdZc24 jRMJHe3dKvttVDoznAHZamaHa9MvazYDDaWPIw8FkolGkZBTci2Yool3kia0kVDiIASQ KVAA==
- In-reply-to: <CAOSMAuu3oUB7eMu_R8ZBEi2ie+07rfBjTC+EQekrVsYFWH4itw@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAOSMAuu3oUB7eMu_R8ZBEi2ie+07rfBjTC+EQekrVsYFWH4itw@mail.gmail.com>
On May 8, 9:00am, Eduardo Bustamante wrote:
}
} I'm not sure if this is working as expected, but the following input
} causes Zsh running with noexec to loop forever.
The basis of this is ${(%%%%EuzktiOn)aY- which is the expansion of $aY
with a whole lot of parameter flags. Since aY is unset, the last "-"
means that most of the flags are instead applied to all the rest of
the crap that follows.
This probably should have been a parse error because the { } are not
balanced, but I'm guessing the parser returns a complete expression
when it hits EOF. Anyway, parameter expansion is one of the few things
that happens in noexec, and those %%%% in the flags list mean to treat
all that garbage as a prompt ... so I suspect it's not actually in an
*infinite* loop, just one that is going to repeat 3333333333333333333
times.
Unless we want to put some arbitrary limits on numbers used in prompt
expansion, I don't think there's anything to be done here. Even if
the unbalanced { } were detected, adding another } at the end of the
file would probably bring back the looping.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author