🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #284

Indirection through NULL pointer in bash-1.02

#284
From: Brian Fox
Date: Mon, 10 Jul 1989 02:21
37 lines
1479 bytes
   Date: 9 Jul 89 21:37:33 GMT
   From: utgpu!watmath!watcgl!andrewt@jarvis.csri.toronto.edu  (Andrew Thomas)

   Bash 1.02 performs an indirection through a null pointer ...

   *** readline.c.orig	Thu Jul  6 13:36:14 1989
   --- readline.c	Sun Jul  9 17:12:00 1989
   ***************
   *** 3797,3803 ****
     {
       register int i;

   !   for (i = 0; funmap[i]->name; i++)
	 if (stricmp (funmap[i]->name, string) == 0)
	   return (funmap[i]->function);
       return ((Function *)NULL);
   --- 3797,3803 ----
     {
       register int i;

   !   for (i = 0; funmap[i] && funmap[i]->name; i++)
	 if (stricmp (funmap[i]->name, string) == 0)
	   return (funmap[i]->function);
       return ((Function *)NULL);
   --

Thanks, Andrew.

This happened in 1.02 because I made funmaps be dynamically allocated,
which changed the test conditions.

You patch is correct, but has too much code;  the solution is

	for (i = 0; funmap[i]; i++)

Brian
Technical Details
Message-ID: <8907100221.AA26973@aurel.caltech.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!AUREL.CALTECH.EDU!bfox
References: <ANDREWT.89Jul9173733@watsnew.waterloo.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!AUREL.CALTECH.EDU!bfox
From: bfox@AUREL.CALTECH.EDU (Brian Fox)
Newsgroups: gnu.bash.bug
Subject: Indirection through NULL pointer in bash-1.02
Message-ID: <8907100221.AA26973@aurel.caltech.edu>
Date: 10 Jul 89 02:21:40 GMT
References: <ANDREWT.89Jul9173733@watsnew.waterloo.edu>
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: bfox@aurel.caltech.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 37