Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!linus!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.unix Subject: Re: rcs blows up on suns Message-ID: <2797@sun.uucp> Date: Fri, 13-Sep-85 22:03:44 EDT Article-I.D.: sun.2797 Posted: Fri Sep 13 22:03:44 1985 Date-Received: Sun, 15-Sep-85 05:13:07 EDT References: <830@panda.UUCP> <1075@sdcsvax.UUCP> <961@sdcsla.UUCP> <967@sdcsla.UUCP> <2772@sun.uucp> <328@tove.UUCP> Distribution: net Organization: Sun Microsystems, Inc. Lines: 33 > In article <2772@sun.uucp> guy@sun.uucp (Guy Harris) writes: > > (Whole damn article cited!) A summary would have been sufficient. > I think that there are a goodly number of null pointer/strcmp bugs > in rcs; we had a minimally version that no one pushed too hard until > recently, when some of these bugs began to pop up. Delving into the > source, I found a *lot* of places that looked like they potentially > had this bug; I'm pretty sure that I had to fix one (not the one above) > just to get it to run at all back when I first brought it up here. We brought up the RCS that came off the 4.2BSD tape at CCI on our Power 5/20s; not only did they prohibit null pointer dereferencing, but they also had 16-bit "int"s and 32-bit pointers, so all the null pointers passed as arguments had to be properly cast and functions had to be properly declared. We never saw any null-pointer-dereference problems other than the one listed. We may not have exercised all the paths through RCS, so there may be others lurking. > Since I was feeling lazy and in a hurry, I just wrote another strcmp > that does relatively intelligent things with null pointers... The only intelligent thing to do with a null pointer is to avoid dereferencing it, and the most intelligent way to do that is to say "if this pointer is null, it probably means that some argument wasn't supplied or something like that. As such, I probably want to do very different processing - something like using the default value for that argument, or not do whatever processing uses that argument's value, or something like that. If I do so, I'll probably automatically avoid dereferencing that null pointer." Guy Harris Brought to you by Super Global Mega Corp .com