Subject: Re: New Sendmail munching root username
To: None <devtrix@netcom.com>
From: Todd Kover <kovert@umiacs.umd.edu>
List: netbsd-help
Date: 09/20/1996 15:32:11
 > Yes, it's weird.  but that's what's happening.
 > 
 > I upgraded to Sendmail 8.7.6 yesterday before the daily system log update 
 > went through.  Now, instead of "Charlie Root" as the addressee, it 
 > shows up in elm as:
 > 
 > 2   Sep 19 Charlie ????D???@? (69)   daily output                        
 > 
 > 
 > looking in the actual inbox, I see this:
 > 
 > From: "Charlie ^P0xce0xbf0xf7D0xce0xbf0xf7@0xce0xbf0xf7]0xce0xbf0xf7m0xd0^C"
 <ro
 > ot>
 > 
 > This must be some clash between new Sendmail and the name "Charlie &" in 
 > the passwd file.  But what is it?

bug in 8.7.6, it's doing sizeof() on a pointer, when it shouldn't be.

fix attached.

-Todd

---<snip>---
*** src/util.c	1996/09/18 22:37:42	1.5
--- src/util.c	1996/09/20 15:17:45
***************
*** 418,424 ****
  	{
  		if (*p == '&')
  		{
! 			snprintf(bp, SPACELEFT(buf, bp), "%s", login);
  			*bp = toupper(*bp);
  			bp += strlen(bp);
  		}
--- 418,424 ----
  	{
  		if (*p == '&')
  		{
! 			snprintf(bp, (size_t)buflen - ((size_t)(bp-buf)), "%s", login);
  			*bp = toupper(*bp);
  			bp += strlen(bp);
  		}