From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29006 invoked from network); 12 Oct 2008 15:14:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL autolearn=unavailable version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 12 Oct 2008 15:14:30 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 76710 invoked from network); 12 Oct 2008 15:14:08 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 12 Oct 2008 15:14:08 -0000 Received: (qmail 27875 invoked by alias); 12 Oct 2008 15:13:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25859 Received: (qmail 27850 invoked from network); 12 Oct 2008 15:13:50 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 12 Oct 2008 15:13:50 -0000 Received: from cork.scru.org (cork.scru.org [209.20.67.2]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 2CE0D80524C0 for ; Sun, 12 Oct 2008 17:13:45 +0200 (CEST) Received: by cork.scru.org (Postfix, from userid 1000) id 181EA1040BC; Sun, 12 Oct 2008 15:13:44 +0000 (UTC) Date: Sun, 12 Oct 2008 15:13:44 +0000 From: Clint Adams To: zsh-workers@sunsite.dk Subject: PATCH: possible null dereference with RC_QUOTES Message-ID: <20081012151344.GA18912@scru.org> Mail-Followup-To: zsh-workers@sunsite.dk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: ClamAV 0.92.1/8414/Sun Oct 12 05:30:50 2008 on bifrost X-Virus-Status: Clean If tokstr can be NULL, then we don't want to try the *tt1 below. Index: Src/Zle/zle_tricky.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v retrieving revision 1.96 diff -u -r1.96 zle_tricky.c --- Src/Zle/zle_tricky.c 8 Sep 2008 22:18:03 -0000 1.96 +++ Src/Zle/zle_tricky.c 12 Oct 2008 15:12:25 -0000 @@ -1235,7 +1235,7 @@ /* This is done when the lexer reached the word the cursor is on. */ tt = tokstr ? dupstring(tokstr) : NULL; - if (isset(RCQUOTES)) { + if (isset(RCQUOTES) && tt) { char *tt1, *e = tt + zlemetacs - wb; for (tt1 = tt; *tt1; tt1++) { if (*tt1 == Snull) {