[comp.sources.bugs] Bug in sps

kucharsk@number6.Solbourne.COM (William Kucharski) (11/29/90)

This small but nasty bug was causing the recently sps command recently
posted to comp.sources.unix to seg fault and die.  I've sent mail to the author
but felt it was hair-pulling enough to post as well:

*** filecount.c.dist	Wed Nov 28 17:02:26 1990
--- filecount.c	Wed Nov 28 17:02:20 1990
***************
*** 44,50 ****
  		len = User.u_us.u_lastfile * sizeof (struct file *) ;
  		if (len <= 0)
  			return 0;
! 		if (files == 0 || len < files_len)
  		{
  			if (files != 0)
  				free (files) ;
--- 44,50 ----
  		len = User.u_us.u_lastfile * sizeof (struct file *) ;
  		if (len <= 0)
  			return 0;
! 		if (files == 0 || len > files_len)
  		{
  			if (files != 0)
  				free (files) ;
--
| William Kucharski, Solbourne Computer, Inc.     | Opinions expressed above
| Internet:   kucharsk@Solbourne.COM	          | are MINE alone, not those
| uucp:	...!{boulder,sun,uunet}!stan!kucharsk     | of Solbourne...
| Snail Mail: 1900 Pike Road, Longmont, CO  80301 | "It's Night 9 with D2 Dave"