From owner-freebsd-hackers Fri Nov 17 15:18:59 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id PAA05458 for hackers-outgoing; Fri, 17 Nov 1995 15:18:59 -0800 Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id PAA05420 for ; Fri, 17 Nov 1995 15:18:33 -0800 Received: from sax.sax.de by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id AAA19980 for ; Sat, 18 Nov 1995 00:18:16 +0100 Received: by sax.sax.de (8.6.11/8.6.12-s1) with UUCP id AAA07403 for hackers@FreeBSD.ORG; Sat, 18 Nov 1995 00:18:16 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.6.12/8.6.9) id XAA17700 for hackers@FreeBSD.ORG; Fri, 17 Nov 1995 23:35:20 +0100 From: J Wunsch Message-Id: <199511172235.XAA17700@uriah.heep.sax.de> Subject: Re: mountd(8) performs illegal free() To: hackers@FreeBSD.ORG Date: Fri, 17 Nov 1995 23:35:19 +0100 (MET) Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199511171150.MAA25180@allegro.lemis.de> from "Greg Lehey" at Nov 17, 95 12:50:50 pm X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Length: 655 Sender: owner-hackers@FreeBSD.ORG Precedence: bulk As Greg Lehey wrote: > > In the last few -current releases, I've had the message > > Malloc warning: free(): junk pointer (too high) Many have been bothered, few are chosen. :-) > if (hpe == (struct hostent *)NULL) > out_of_mem(); > - hpe->h_name = "Default"; > + hpe->h_name = malloc (16); > + strcpy (hpe->h_name, "Default"); hpe->h_name = strdup("Default"); -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)