From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15189 invoked from network); 1 Aug 2003 15:57:55 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 1 Aug 2003 15:57:55 -0000 Received: (qmail 14932 invoked by alias); 1 Aug 2003 15:57:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18922 Received: (qmail 14922 invoked from network); 1 Aug 2003 15:57:50 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 1 Aug 2003 15:57:50 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.211] by sunsite.dk (MessageWall 1.0.8) with SMTP; 1 Aug 2003 15:57:49 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-8.tower-36.messagelabs.com!1059738825!106003 X-StarScan-Version: 5.0.7; banners=-,-,- Received: (qmail 3051 invoked from network); 1 Aug 2003 11:53:45 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-8.tower-36.messagelabs.com with SMTP; 1 Aug 2003 11:53:45 -0000 Received: from gmcs3.local ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id h71Brj3l026438 for ; Fri, 1 Aug 2003 12:53:45 +0100 Received: from gmcs3.local (localhost [127.0.0.1]) by gmcs3.local (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h71Bu0g03716 for ; Fri, 1 Aug 2003 13:56:00 +0200 X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- From: Oliver Kiddle To: Zsh workers Subject: PATCH: minor bug with f glob qualifier Date: Fri, 01 Aug 2003 13:56:00 +0200 Message-ID: <3714.1059738960@gmcs3.local> An empty spec component for the f glob qualifier could cause an infinite loop in the code. e.g. ls *(f:,755:) This patch fixes that by making it print an error instead. Oliver Index: Src/glob.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/glob.c,v retrieving revision 1.29 diff -u -r1.29 glob.c --- Src/glob.c 20 Feb 2003 08:17:48 -0000 1.29 +++ Src/glob.c 1 Aug 2003 11:49:38 -0000 @@ -814,7 +814,7 @@ } if (how == '=' || how == '-') no |= val & mask; - } else { + } else if (!(end && c == end) && c != ',' && c) { t = 07777; while ((c = *p) == '?' || c == Quest || (c >= '0' && c <= '7')) { @@ -838,7 +838,10 @@ yes |= val; else no |= val; - } + } else { + zerr("invalid mode specification", NULL, 0); + return 0; + } } while (end && c != end); *s = p;