From owner-freebsd-current Sat Oct 12 19:15:12 2002 Delivered-To: freebsd-current@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id 9274C37B404; Sat, 12 Oct 2002 19:15:10 -0700 (PDT) Date: Sat, 12 Oct 2002 19:15:10 -0700 From: Juli Mallett To: Terry Lambert Cc: Kris Kennaway , current@FreeBSD.org, alfred@FreeBSD.org Subject: Re: rpcgen dumping core Message-ID: <20021012191510.A39512@FreeBSD.org> References: <20021012225839.GA96586@xor.obsecurity.org> <3DA8D1BA.D440D106@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3DA8D1BA.D440D106@mindspring.com>; from tlambert2@mindspring.com on Sat, Oct 12, 2002 at 06:51:54PM -0700 Organisation: The FreeBSD Project X-Alternate-Addresses: , , , , X-Towel: Yes X-LiveJournal: flata, jmallett X-Negacore: Yes Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * De: Terry Lambert [ Data: 2002-10-12 ] [ Subjecte: Re: rpcgen dumping core ] > Kris Kennaway wrote: > > rpcgen -s `perl -e 'print "a"x5120'` > > rpcgen -n `perl -e 'print "a"x5120'` > > > > will both segfault when you ^D them. > > > The fix works by substituting "" for NULL before this happens, > but *after* the output file names have been created, to avoid > creating files with a bogus prefix name. > > Index: rpc_svcout.c > =================================================================== > RCS file: /cvs/src/usr.bin/rpcgen/rpc_svcout.c,v > retrieving revision 1.14 > diff -c -r1.14 rpc_svcout.c > *** rpc_svcout.c 21 Jul 2002 12:55:04 -0000 1.14 > --- rpc_svcout.c 12 Oct 2002 21:47:39 -0000 > *************** > *** 107,112 **** > --- 107,115 ---- > int netflag; > int nomain; > { > + if (!infile) > + infile = ""; > + > if (inetdflag || pmflag) { > char* var_type; > var_type = (nomain? "extern" : "static"); Personally, I'd rather see it be: if (infile == NULL) infile = "-"; As that's how we tend to represent stdin, yes? -- Juli Mallett | FreeBSD: The Power To Serve Will break world for fulltime employment. | finger jmallett@FreeBSD.org http://people.FreeBSD.org/~jmallett/ | Support my FreeBSD hacking! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message