[comp.mail.sendmail] Patch: Sendmail 5.61 core dumps on long lists

reggers@ria.ccs.uwo.ca (Reg Quinton) (05/31/90)

We were having trouble with sendmail core dumping when dealing with
long recipient lists (at least with 5.61 on our Mips machine). I
managed to localize the problem into deliver.c and the deliver()
procedure where the string array "tobuf" was causing the problem -- to
much data was being written into the array and this was corrupting
other structures on the stack.

The following patch fixed that problem.

*** deliver.c	Wed May 30 14:45:02 1990
--- deliver.c.orig	Wed May 30 15:35:32 1990
***************
*** 221,227 ****
  			continue;
  
  		/* avoid overflowing tobuf */
! 		if ((strlen(to->q_paddr) + strlen(tobuf) + 2) > sizeof(tobuf))
  			break;
  
  		if (tTd(10, 1))
--- 221,227 ----
  			continue;
  
  		/* avoid overflowing tobuf */
! 		if (sizeof tobuf - (strlen(to->q_paddr) + strlen(tobuf) + 2) < 0)
  			break;
  
  		if (tTd(10, 1))