rcs blows up on suns

Steve D. Miller steve at tove.UUCP
Wed Sep 11 13:36:52 AEST 1985


In article <2772 at sun.uucp> guy at sun.uucp (Guy Harris) writes:
>> As I stated in my original reply, dereferencing zero is always
>> a bad idea, even though it `works' (returns 0) on Vaxen.   So,
>> it isn't Sun's fault per se, and I don't think RCS is really
>> a supported product of Sun Microsystems... (anyone from Sun
>> care to comment on this?).
>
>RCS is not a supported product of Sun Microsystems.  SMI doesn't distribute
>RCS on any of its standard distribution tapes.
>
>Here's a fix to "rcs.c" to keep it from dropping core (this fix was
>originally discovered on another 68000-family machine which prohibits
>dereferencing null pointers):
>
>*** rcs.c.broken	Sun Sep  8 15:25:18 1985
>--- rcs.c	Sun Sep  8 15:26:51 1985
>***************
>*** 982,988
>          dummy.nextlock=next=Locks;
>          trail = &dummy;
>          while (next!=nil) {
>!                numr = strcmp(num, next->delta->num);
>                 if ((whor=strcmp(who,next->login))==0 &&
>                    (num==nil || numr==0))
>                          break; /* found a lock */
>
>--- 982,989 -----
>          dummy.nextlock=next=Locks;
>          trail = &dummy;
>          while (next!=nil) {
>!                if(num!=nil)
>!                        numr = strcmp(num, next->delta->num);
>                 if ((whor=strcmp(who,next->login))==0 &&
>                    (num==nil || numr==0))
>                          break; /* found a lock */
>
>	Guy Harris


   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.
Since I was feeling lazy and in a hurry, I just wrote another strcmp
that does relatively intelligent things with null pointers and changed
the makefile so that everything that looked suspicious had my version
linked in.  I readily admit that I should have tracked down all the
potential strangenesses and fixed them individually, but it looks like
it'd take a lot of time to do and I'm swamped as it is...

	-Steve



More information about the Comp.unix mailing list