[looks correct. testcase would be nice. -kingdon, 1997 or so Haven't looked at this again in any detail. -kingdon, May 1998] From: karlb@atg.com Date: Tue, 5 Aug 1997 09:33:05 -0400 To: bug-cvs@prep.ai.mit.edu Subject: cvs 1.9.14 history core dump cvs 1.9.14 core dumps on our 16MB history file with cvs history -a -T, running on sparc-solaris2.4. This is because various fields are not present in all entries. Perhaps the history file is corrupted, but I think CVS should still detect that and either complain or proceed as best it can. Here's a patch making the checks I found necessary. I'd include the relevant input, but I don't know where to find it. The history file entry is: TTData||atg/projects/NTTData which is pretty clearly bogus. *** ORIG/history.c Tue Jul 8 12:22:43 1997 --- history.c Tue Aug 5 09:26:03 1997 *************** *** 1398,1412 **** (void) strcpy (cp, "*"); } } ! if ((i = strlen (lr->user)) > user_len) user_len = i; ! if ((i = strlen (lr->file)) > file_len) file_len = i; if (ty != 'T' && (i = strlen (repos)) > repos_len) repos_len = i; ! if (ty != 'T' && (i = strlen (lr->rev)) > rev_len) rev_len = i; ! if (lr->mod && (i = strlen (lr->mod)) > mod_len) mod_len = i; free (repos); } --- 1398,1412 ---- (void) strcpy (cp, "*"); } } ! if (lr->user && (i = strlen (lr->user)) > user_len) user_len = i; ! if (lr->file && (i = strlen (lr->file)) > file_len) file_len = i; if (ty != 'T' && (i = strlen (repos)) > repos_len) repos_len = i; ! if (lr->rev && ty != 'T' && (i = strlen (lr->rev)) > rev_len) rev_len = i; ! if (lr->mod && lr->mod && (i = strlen (lr->mod)) > mod_len) mod_len = i; free (repos); } *************** *** 1467,1473 **** { case 'T': /* 'T'ag records: repository is a "tag type", rev is the tag */ ! (void) printf (" %-*s [%s:%s]", mod_len, lr->mod, lr->rev, repos); if (working) (void) printf (" {%s}", workdir); --- 1467,1475 ---- { case 'T': /* 'T'ag records: repository is a "tag type", rev is the tag */ ! (void) printf (" %-*s [%s:%s]", mod_len, ! lr->mod ? lr->mod : "", ! lr->rev ? lr->rev : "", repos); if (working) (void) printf (" {%s}", workdir);