From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7964 invoked by alias); 14 Feb 2015 21:45: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: 34545 Received: (qmail 7300 invoked from network); 14 Feb 2015 21:45:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Originating-IP: [86.6.153.127] X-Spam: 0 X-Authority: v=2.1 cv=VLdTnr/X c=1 sm=1 tr=0 a=39NrsSuza2clQiZR/7fYWQ==:117 a=39NrsSuza2clQiZR/7fYWQ==:17 a=kj9zAlcOel0A:10 a=NLZqzBF-AAAA:8 a=q2GGsy2AAAAA:8 a=jzI_P5QQEnIhUtb6h3UA:9 a=CjuIK1q_8ugA:10 Date: Sat, 14 Feb 2015 21:42:09 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: PATCH: Crash bug on garbage input (previously reported to Debian) Message-ID: <20150214214209.6d2f5e7e@ntlworld.com> In-Reply-To: <150214102534.ZM4368@torch.brasslantern.com> References: <150214102534.ZM4368@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 14 Feb 2015 10:25:34 -0800 Bart Schaefer wrote: > Garbage input (nul bytes, etc.) can cause the newly-introduced $(...) > parser to become confused during look-ahead and back up the input too > far before attempting a different parse. > > The patch below simply detects the problem and turns it into a parse > error with an appropriate warning. It might be helpful to figure out > how the confusion originates but this prevents the crash. Hmmm... backup characters are simply matched with input characters. Could it be something to do with multibyte? If it's just invalid characters, your fix is probably good enough in practice. If it's a problem with real multibyte characters we need to do more.e can (I suspect we can do better with the jungle of input and history character reading, which is a bit of a mess, though that's not really relevant to the problem since I don't think the mess is causing any problems in character counting.) pws