Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!ut-sally!husc6!rutgers!ames!lll-tis!elxsi!marduk!gww From: gww@marduk.UUCP (Gary Winiger) Newsgroups: comp.bugs.4bsd Subject: bin/make dereferences a NULL pointer if VPATH is not defined. +Fix Message-ID: <503@elxsi.UUCP> Date: Fri, 4-Sep-87 17:31:26 EDT Article-I.D.: elxsi.503 Posted: Fri Sep 4 17:31:26 1987 Date-Received: Sat, 5-Sep-87 20:46:57 EDT Sender: nobody@elxsi.UUCP Reply-To: gww@marduk.UUCP (Gary Winiger) Organization: ELXSI Super Computers, San Jose Lines: 63 Subject: bin/make dereferences a NULL pointer if VPATH is not defined. +Fix Index: bin/make/files.c 4.3BSD +Fix Description: If the macro VPATH is not defined in the Makefile, make attempts to determine this by dereferencing a NULL pointer. On certain systems this will cause a segmentation fault. Repeat-By: Running make against a Makefile without VPATH defined on a system that will not allow NULL pointer dereferencing. Fix: Check to see if the pointer is NULL before dereferencing it. The attached fix resolves this problem at our site. Gary.. {ucbvax!sun,lll-lcc!lll-tis,amdahl!altos86,bridge2}!elxsi!gww --------- cut --------- snip --------- :.,$w diff ------------- *** /tmp/,RCSt1000523 Fri Dec 12 17:30:39 1986 --- /usr/src/bin/make/files.c Fri Dec 12 17:28:15 1986 *************** *** 1,10 **** /* * $Log: files.c,v $ * Revision 1.1 86/12/11 12:53:15 gww * Initial revision * */ ! static char *ERcsId = "$Header: files.c,v 1.1 86/12/11 12:53:15 gww Exp $ ENIX BSD"; static char *sccsid = "@(#)files.c 4.12 (Berkeley) 86/01/09"; #include --- 1,17 ---- /* * $Log: files.c,v $ + * Revision 1.2 86/12/12 17:27:34 gww + * Don't dereference null pointer when VPATH is not defined. + * * Revision 1.1 86/12/11 12:53:15 gww * Initial revision * */ ! static char *ERcsId = "$Header: files.c,v 1.2 86/12/12 17:27:34 gww Exp $ ENIX BSD"; static char *sccsid = "@(#)files.c 4.12 (Berkeley) 86/01/09"; #include *************** *** 230,236 **** dirpref = ""; filepat = pat; cp = varptr("VPATH"); ! if (*cp->varval == 0) path = "."; else { path = pth; *path = '\0'; --- 237,243 ---- dirpref = ""; filepat = pat; cp = varptr("VPATH"); ! if (cp->varval == NULL || *cp->varval == 0) path = "."; else { path = pth; *path = '\0';