zsh-workers
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: zsh-workers@math.gatech.edu (Zsh hacking and development)
Subject: PATCH: glob coredump fix
Date: Sat, 9 May 1998 15:13:59 -0500 (CDT)	[thread overview]
Message-ID: <199805092014.PAA01899@hzoli.home> (raw)

% ./zsh -f
% setopt extendedglob
% echo ((#))
zsh: bad pattern: ((#))
% echo *.c
zsh: 1779 segmentation fault (core dumped)  ./zsh -f

tail was assumed to be always NULL when pattern parsing was called.

3.0.5 already has this fix.  There were significant changes in glob.c
since 3.1.2, but this patch still seems to work.

Zoli


*** Src/glob.c.orig	Sat May  9 15:02:46 1998
--- Src/glob.c	Sat May  9 15:06:05 1998
*************** struct comp {
*** 125,131 ****
  #define GF_TOPLEV	2	/* outside (), so ~ ends main match */
  
  static char *pptr;		/* current place in string being matched */
! static Comp tail = 0;
  static int first;		/* are leading dots special? */
  
  /**/
--- 125,131 ----
  #define GF_TOPLEV	2	/* outside (), so ~ ends main match */
  
  static char *pptr;		/* current place in string being matched */
! static Comp tail;
  static int first;		/* are leading dots special? */
  
  /**/
*************** parsepat(char *str)
*** 802,807 ****
--- 802,808 ----
  {
      mode = 0;			/* path components present */
      pptr = str;
+     tail = NULL;
      return parsecomplist();
  }
  
*************** parsereg(char *str)
*** 2434,2439 ****
--- 2435,2441 ----
      remnulargs(str);
      mode = 1;			/* no path components */
      pptr = str;
+     tail = NULL;
      return parsecompsw(GF_TOPLEV);
  }
  


                 reply	other threads:[~1998-05-09 22:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199805092014.PAA01899@hzoli.home \
    --to=hzoli@cs.elte.hu \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).