[comp.mail.sendmail] Sendmail 5.61 dumps core if username > 8 chars

andrew@stl.stc.co.uk (Andrew Macpherson) (10/30/89)

Description:
	If the value returned by "" does not match your passwd entry,
	(it has been truncated for instance), one will de-reference a 
	null pointer in "username".  This results in a segmentation
	violation on a SUN
Repeat-By:
	Arrange to log in as "postmaster", attempt to send mail
Fix:
	Apply this patch.

Index: conf.c
Prereq: 5.17
*** conf.oc	Sun Oct 29 22:18:28 1989
--- conf.c	Sun Oct 29 22:23:32 1989
***************
*** 229,236 ****
  		else
  		{
  
! 			pw = getpwnam(myname);
! 			if(getuid() != pw->pw_uid)
  			{
  				pw = getpwuid(getuid());
  				if (pw != NULL)
--- 229,236 ----
  		else
  		{
  
! 			if((pw = getpwnam(myname)) == NULL
! 			   || (getuid() != pw->pw_uid))
  			{
  				pw = getpwuid(getuid());
  				if (pw != NULL)

andrew@stl.stc.co.uk (Andrew Macpherson) (10/30/89)

Description:
	If the value returned by "getlogin" does not match your passwd
	entry, (it has been truncated for instance), one will
	de-reference a null pointer in "username".  This results in a
	segmentation violation on a SUN
Repeat-By:
	Arrange to log in as "postmaster", attempt to send mail
Fix:
	Apply this patch.

Index: conf.c
Prereq: 5.17
*** conf.oc	Sun Oct 29 22:18:28 1989
--- conf.c	Sun Oct 29 22:23:32 1989
***************
*** 229,236 ****
  		else
  		{
  
! 			pw = getpwnam(myname);
! 			if(getuid() != pw->pw_uid)
  			{
  				pw = getpwuid(getuid());
  				if (pw != NULL)
--- 229,236 ----
  		else
  		{
  
! 			if((pw = getpwnam(myname)) == NULL
! 			   || (getuid() != pw->pw_uid))
  			{
  				pw = getpwuid(getuid());
  				if (pw != NULL)