Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!prls!pyramid!decwrl!sun!glenn From: glenn@sun.uucp (Glenn C. Skinner) Newsgroups: net.bugs.4bsd Subject: csh "source -h" causes core dump Message-ID: <4879@sun.uucp> Date: Tue, 8-Jul-86 16:15:07 EDT Article-I.D.: sun.4879 Posted: Tue Jul 8 16:15:07 1986 Date-Received: Wed, 9-Jul-86 06:17:03 EDT Distribution: net Organization: Sun Microsystems, Inc. Lines: 41 Index: bin/csh/sh.c 4.3BSD This bug report/fix applies to version 5.3 (3/29/86) of sh.c, which is the version contained in the 4.3 distribution. Description: Invoking the C shell builtin ~source" with the "-h" flag but with no argument causes a core dump on machines that object to null pointer dereferences. Repeat-By: Invoke "source -h" from an interactive C shell. Fix: The problem is dereferencing a null pointer in sh.c:dosource(). Applying the following context diff cures the problem. Your line numbers will differ. -- Glenn Skinner, SMI ------- sh.c ------- *** /tmp/da5325 Tue Jul 8 12:28:25 1986 --- sh.c Thu Jul 3 13:03:00 1986 *************** *** 812,820 **** char buf[BUFSIZ]; t++; if (*t && eq(*t, "-h")) { ! t++; hflg++; } (void) strcpy(buf, *t); f = globone(buf); --- 812,821 ---- char buf[BUFSIZ]; t++; if (*t && eq(*t, "-h")) { ! if (*++t == NOSTR) ! bferr("No operand for -h flag"); hflg++; } (void) strcpy(buf, *t); f = globone(buf);