Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site linus.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!linus!sid From: sid@linus.UUCP (Sid Stuart) Newsgroups: net.bugs.4bsd Subject: Bug in find Message-ID: <196@linus.UUCP> Date: Sat, 16-Feb-85 18:52:10 EST Article-I.D.: linus.196 Posted: Sat Feb 16 18:52:10 1985 Date-Received: Tue, 19-Feb-85 08:32:48 EST Distribution: net Organization: The MITRE Coporation, Bedford, MA Lines: 50 Date: Feb 16 1985 From: Sid Stuart at linus!sid Subject: Fix for find dumping core. Index: find.c 4.2 Description: Find dumped core on me. The problem occurs when the code uses a table of pointers to functions. Most of the functions want a pointer to a structure passed to them as a parameter. Three of them don't, print, cpio, and newer. When the pointer to one of these is used, the pointer to the structure is passed, but they are not set up to handle it. The fix is pretty obvious, have them accept the pointer, even though they don't use it. Repeat by: Well, it dumped core on me when I said, find / -user news -print | more but I think the malfunction could be random. Fix: This is from a "diff find.old find.fixed" 287c301,308 < print() --- > print(trash) /* The trash variable is not used. It is needed because > the function is called by pointer from a table. > When functions are called from the table, they > passed a pointer to an anode structure. > If print does not accept this argument, find will sometimes > dump core. > */ > register struct anode *trash; 371c401,402 < cpio() --- > cpio(trash) /* The trash variable is not used. See definition of print. */ > register struct anode *trash; 428c459,460 < newer() --- > newer(trash) /* The trash variable is not used. See definition of print. */ > register struct anode *trash; /* End of bug report */