* De: Terry Lambert <[EMAIL PROTECTED]> [ 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 <[EMAIL PROTECTED]> | FreeBSD: The Power To Serve Will break world for fulltime employment. | finger [EMAIL PROTECTED] http://people.FreeBSD.org/~jmallett/ | Support my FreeBSD hacking! To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message