		6) BAD sprintf() call in cntrl.c


From: teklabs!ucbvax!mhtsa!ihnss!harpo!floyd!cmcl2!salkind
Date: Wed May 26 23:10:05 1982
Subject: uucp cntrl.c bug fix (again)
Newsgroups: net.bugs.4bsd,net.bugs

A while back I reported a bug in uucp about two uninitialized pointers
that could cause occasional core dumps.  The bug fixes I gave
will actually work, but here is a clearly superior way of doing it.

------- Forwarded Message

>From floyd!harpo!bunker!peter Wed May 26 13:32:02 1982
Date: Wed May 26 13:29:55 1982
To: harpo!floyd!cmcl2!salkind
Subject: netnews uucp bug fix (cntrl.c)
Status: R

I have a copy of a news item outline two changes which are supposed
to check for use of two unitialized character string pointers.
After reading the code and your changes, it appears that your changes
will not guarantee that the pointers have been properly initialized
by "gtwvec".  In addition, moving the "mailopt" assignment statement
after checking for "wrktype == XUUCP" would leave the mailopt flag
unset for that case.  I suggest:

126c126
< 		mailopt = (i > 4) && (index(W_OPTNS, 'm') != NULL);
---
> 		mailopt = index(W_OPTNS, 'm') != NULL;
144c144
< 			W_OPTNS, i > 5 ? W_DFILE : "", i > 6 ? W_MODE : "");
---
> 			W_OPTNS, W_DFILE, W_MODE);

as changes to cntrl.c, instead.

	Peter Stevens
	Bunker Ramo 
	Information Systems Division
	Trumbull, Connecticut

	(harpo!bunker!peter or decvax!bunker!peter)

------- End Forwarded Message


------

[ This was also fixed by: ]

From: teklabs!decvax!cca!HOLSTEGE@Cit-20@sri-unix
Date: Sun Aug 15 00:41:34 1982

From: teklabs!decvax!cca!hplabs!kg
Date: Sun Aug  8 12:30:55 1982
