Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!ames!lll-tis!elxsi!marduk!gww From: gww@marduk.UUCP (Gary Winiger) Newsgroups: comp.bugs.4bsd Subject: Man without a title will derefernece a null pointer. +Fix Message-ID: <507@elxsi.UUCP> Date: Fri, 4-Sep-87 17:53:07 EDT Article-I.D.: elxsi.507 Posted: Fri Sep 4 17:53:07 1987 Date-Received: Sat, 5-Sep-87 20:51:11 EDT Sender: nobody@elxsi.UUCP Reply-To: gww@marduk.UUCP (Gary Winiger) Organization: ELXSI Super Computers, San Jose Lines: 58 Subject: Man without a title will derefernece a null pointer. +Fix Index: ucb/man 4.3BSD +Fix Description: Man without a title but with switches will dereference a null pointer when trying to reference the title. Repeat-By: man -l Fix: The attached code resolves this problem at Elxsi. Gary.. {ucbvax!sun,lll-lcc!lll-tis,amdahl!altos86,bridge2}!elxsi!gww --------- cut --------- snip --------- :.,$w diff ------------- *** /tmp/,RCSt1002229 Tue Dec 23 16:47:27 1986 --- man.c Tue Dec 23 16:46:33 1986 *************** *** 1,5 **** --- 1,8 ---- /* * $Log: man.c,v $ + * Revision 1.2 86/12/23 16:44:26 gww + * Correct null pointer reference when no title is given. + * * Revision 1.1 86/12/22 13:43:58 gww * Initial revision * *************** *** 17,23 **** #endif not lint #ifndef lint ! static char *ERcsId = "$Header: man.c,v 1.1 86/12/22 13:43:58 gww Exp $ ENIX BSD"; static char sccsid[] = "@(#)man.c 5.12 (Berkeley) 3/20/86"; #endif not lint --- 20,26 ---- #endif not lint #ifndef lint ! static char *ERcsId = "$Header: man.c,v 1.2 86/12/23 16:44:26 gww Exp $ ENIX BSD"; static char sccsid[] = "@(#)man.c 5.12 (Berkeley) 3/20/86"; #endif not lint *************** *** 123,128 **** --- 126,135 ---- break; } argc--, argv++; + } + if (argc < 1) { + fprintf(stderr, "Usage: man [ section ] name ...\n"); + exit(1); } if (troffit == 0 && nomore == 0 && !isatty(1)) nomore++;