From: utzoo!decvax!cca!hartwell%Shasta@SU-Score@sri-unix Newsgroups: net.unix-wizards Title: uucp(versys.c) bug Article-I.D.: sri-unix.4716 Posted: Tue Dec 7 19:56:39 1982 Received: Thu Dec 9 02:39:54 1982 From: Steve Hartwell Date: Wednesday, 1 Dec 1982 14:28-PST in versys.c, while reading from the L.sys file, right after the fgets(line..., there is a line: *(index(line, ' ')) = '\0'; If the L.sys line does not terminate the system name with a blank (i.e., with a tab (\t) instead), this will cause a core dump on some systems. Index should never be used 'blindly', I have learned. This line, and the "line[7] = '\0'" statement below it can be replaced with the statement: sscanf(line, "%7s", line); I frequently use sscanf to do string parsing for me. This will guarantee that the string is null-terminated and at most 7 characters long. Apologies if this bug has already been reported. Steve Hartwell