From owner-freebsd-current Sat Feb 7 11:21:32 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA17391 for current-outgoing; Sat, 7 Feb 1998 11:21:32 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA17384 for ; Sat, 7 Feb 1998 11:21:27 -0800 (PST) (envelope-from jdp@austin.polstra.com) Received: from austin.polstra.com (jdp@localhost) by austin.polstra.com (8.8.8/8.8.8) with ESMTP id LAA18068; Sat, 7 Feb 1998 11:21:24 -0800 (PST) (envelope-from jdp) Message-Id: <199802071921.LAA18068@austin.polstra.com> To: scottm@cs.ucla.edu Subject: Re: cvs bug (and fix) In-Reply-To: <199802062246.OAA03856@mordred.cs.ucla.edu> References: <199802062246.OAA03856@mordred.cs.ucla.edu> Organization: Polstra & Co., Seattle, WA Cc: current@FreeBSD.ORG Date: Sat, 07 Feb 1998 11:21:24 -0800 From: John Polstra Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe current" In article <199802062246.OAA03856@mordred.cs.ucla.edu>, Scott Michel wrote: > This one's been driving me batshit for the last couple of days. I'm > surprised no one else has encountered it yet. > > Line 6016 in /usr/src/contrib/cvs/src/rcs.c needs to be changed from > > if (n == EOF) > > to > > if (n == EOF || num == NULL) > > Otherwise you get spurious assert's in findnode() a little later on. It looks like only an invalid RCS file could cause that to happen. (Which of course doesn't make it any less of a bug.) Is that right? > Can someone change, approve, and check this in? TIA The fix doesn't look quite right to me. A revision number was expected, but something else (not EOF) was found instead. Shouldn't it report an error? How about something like this: if (n == EOF) { /* If n == EOF and num == NULL, it means we reached EOF naturally. That's fine. */ if (num == NULL) return NULL; else error (1, 0, "%s: unexpected EOF", rcs->path); } else if (num == NULL) error (1, 0, "%s: file contains invalid revision number", rcs->path); -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth