From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8678 invoked by alias); 10 May 2017 06:43:14 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41084 Received: (qmail 4696 invoked from network); 10 May 2017 06:43:14 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua0-f173.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.217.173):SA:0(-0.0/5.0):. Processed in 0.596183 secs); 10 May 2017 06:43:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.217.173 as permitted sender) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=jlpM/Hf3R6Uinm8mraTX7XuqAd27NTiQ0l9lTV0frMo=; b=n8io8ORiZp3Pv2AtGvuphV3Jw79HNmGXSSu0PGTKgz1aIAAsGFtaLw7JxKfUTw/0bR 9v1wpYu47GQ+yCm04EzRcPuaSbpNVFurr7v+puRJHUrujl1Q/o9TlLF68Vp4BDv4dZmP GgYwl0alrNSdvcM7x6BPA2a0qJuKpIF6z7TWDKhdMxMPW1uRDAWOX75c3iLIv/GJep3v rLoa9FKBZz6hAeo8vVV2XLru/Hc2E606n4LhM2xaC/ZKt6Ibe0jqpEK5ecjKVJOsthEe aC7rlxNFCqCQ2nDwm/iXYkC7OGoPgNbQvbQloso3XSEnoQUnxd//TwD6eI29cJlmC6uP UU0Q== X-Gm-Message-State: AODbwcDPMv6c5QDfK/0XtdIOknv6aZ5TJ+b0N19vnlB/fKaGfWCfkddg 80pXTFUCMYbZZznA X-Received: by 10.159.48.144 with SMTP id j16mr2100929uab.131.1494398588621; Tue, 09 May 2017 23:43:08 -0700 (PDT) From: Bart Schaefer Message-Id: <170509234322.ZM7806@torch.brasslantern.com> Date: Tue, 9 May 2017 23:43:22 -0700 In-Reply-To: Comments: In reply to Eduardo Bustamante "Zsh parser infinite loop in chuck from utils.c on malformed input" (May 8, 9:00am) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org, zsh-workers@zsh.org Subject: Re: Zsh parser infinite loop in chuck from utils.c on malformed input MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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.