Date: Fri, 17 Nov 1995 12:50:50 +0100 (MET) From: grog@lemis.de (Greg Lehey) To: hackers@freebsd.org (FreeBSD Hackers) Subject: mountd(8) performs illegal free() Message-ID: <199511171150.MAA25180@allegro.lemis.de>
next in thread | raw e-mail | index | archive | help
In the last few -current releases, I've had the message
Malloc warning: free(): junk pointer (too high)
at system startup. It comes from mountd, and it's wrong: the address
being freed is in the text segment.
Is this intentional? Should free(3) even try to accept this sort of
behaviour? In any case, it's easy enough to fix:
--- mountd.c 1995/06/27 11:06:19 1.9
+++ mountd.c 1995/11/17 11:44:06
@@ -885,7 +885,8 @@
hpe = (struct hostent *)malloc(sizeof(struct hostent));
if (hpe == (struct hostent *)NULL)
out_of_mem();
- hpe->h_name = "Default";
+ hpe->h_name = malloc (16);
+ strcpy (hpe->h_name, "Default");
hpe->h_addrtype = AF_INET;
hpe->h_length = sizeof (u_long);
hpe->h_addr_list = (char **)NULL;
Greg
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511171150.MAA25180>
