🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.misc
Article #79

Minor bug in Pathalias

#79
From: Matt Costello
Date: Wed, 01 Jul 1987 21:08
40 lines
1815 bytes
There is a minor bug in the pathalias(1) program.
The bug causes pathalias to dump core when it runs out of
memory.  It is in the routine mymalloc() in the file mem.c;
its sccsid is
	mem.c	8.3 (down!honey) 86/06/08

The problem is that the mymalloc() routine does not check the
malloc(3) return value before trying to clear the memory returned
by malloc.  The published maps are getting big enough that a
process size of 1 MB is no longer big enough to run pathalias.

This bug is present in both the January 1986 and November 1986
distributions.  The following is a context diff of the change
for the November 1986 distribution:

*** mem.c.orig	Fri Feb  6 20:54:24 1987
--- mem.c	Wed Jul  1 13:24:38 1987
***************
*** 199,205
  
  	if (n >= 1024) {		/* for hash table */
  		rval = malloc(n);	/* aligned */
! 		strclear(rval, n);
  		return(rval);
  	}
  

--- 199,206 -----
  
  	if (n >= 1024) {		/* for hash table */
  		rval = malloc(n);	/* aligned */
! 		if (rval != 0)
! 			strclear(rval, n);
  		return(rval);
  	}
  
-- 
Matt Costello	<matt.costello@SanDiego.NCR.COM>
+1 619 485 2926	<matt.costello%SanDiego.NCR.COM@Relay.CS.NET>
		{sdcsvax,cbosgd,pyramid,nosc.ARPA,ihnp4}!ncr-sd!matt
Technical Details
Message-ID: <1596@ncr-sd.SanDiego.NCR.COM>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcnc!gatech!hubcap!ncrcae!ncr-sd!matt

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcnc!gatech!hubcap!ncrcae!ncr-sd!matt
From: matt@ncr-sd.SanDiego.NCR.COM (Matt Costello)
Newsgroups: comp.bugs.misc
Subject: Minor bug in Pathalias
Message-ID: <1596@ncr-sd.SanDiego.NCR.COM>
Date: Wed, 1-Jul-87 17:08:10 EDT
Article-I.D.: ncr-sd.1596
Posted: Wed Jul  1 17:08:10 1987
Date-Received: Fri, 3-Jul-87 00:46:56 EDT
Reply-To: matt@ncr-sd.SanDiego.NCR.COM (Matt Costello)
Distribution: world
Organization: NCR Corporation, Rancho Bernardo
Lines: 40
Keywords: pathalias