zsh-workers
 help / color / mirror / code / Atom feed
* Another crash bug in "print"
@ 2003-03-28 17:35 Bart Schaefer
  2003-03-28 18:23 ` Wayne Davison
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Schaefer @ 2003-03-28 17:35 UTC (permalink / raw)
  To: zsh-workers

I just stumbled upon this in zsh 3.0.7, but it's still there in 4.1.0-dev7
(latest CVS):

zagzig% print -m
zsh: segmentation fault (core dumped)  Src/zsh -f

#0  0x806b0b3 in zshtokenize (s=0x0, shglob=0) at ../../zsh-4.0/Src/glob.c:2469
2469        for (; *s; s++) {
(gdb) where
#0  0x806b0b3 in zshtokenize (s=0x0, shglob=0) at ../../zsh-4.0/Src/glob.c:2469
#1  0x806b07e in tokenize (s=0x0) at ../../zsh-4.0/Src/glob.c:2452
#2  0x80542e6 in bin_print (name=0x40015178 "print", args=0xbffff41c, 
    ops=0xbffff448, func=13) at ../../zsh-4.0/Src/builtin.c:3115

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Another crash bug in "print"
  2003-03-28 17:35 Another crash bug in "print" Bart Schaefer
@ 2003-03-28 18:23 ` Wayne Davison
  0 siblings, 0 replies; 2+ messages in thread
From: Wayne Davison @ 2003-03-28 18:23 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

On Fri, Mar 28, 2003 at 05:35:10PM +0000, Bart Schaefer wrote:
> zagzig% print -m
> zsh: segmentation fault (core dumped)  Src/zsh -f

This looks like the right fix to me:

Index: Src/builtin.c
--- Src/builtin.c	17 Feb 2003 10:08:03 -0000	1.97
+++ Src/builtin.c	28 Mar 2003 18:21:25 -0000
@@ -3111,7 +3111,11 @@
     if (OPT_ISSET(ops,'m')) {
 	Patprog pprog;
 	char **t, **p;
-	
+
+	if (!*args) {
+	    zwarnnam(name, "no pattern specified", NULL, 0);
+	    return 1;
+	}
 	tokenize(*args);
 	if (!(pprog = patcompile(*args, PAT_STATIC, NULL))) {
 	    untokenize(*args);

..wayne..


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-28 18:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-28 17:35 Another crash bug in "print" Bart Schaefer
2003-03-28 18:23 ` Wayne Davison

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).