Xymon Mailing List Archive search

BUG: Glibc 'free(): invalid next size' in bbcmd on FC5

list Henrik Størner
Sat, 5 Aug 2006 22:40:31 +0200
Message-Id: <user-7a8d76be8fc9@xymon.invalid>

On Fri, Aug 04, 2006 at 12:33:37PM -0700, Japheth J.C. Cleaver wrote:
Running "bbcmd" after a clean install (default configuration, current allinone patch) results in a glibc free() error. This is on Fedora Core 5 with Glibc2.4-8. Running as "MALLOC_CHECK_=0 ./bbcmd" is a temporary workaround.
Thanks, this appears to be a 1-byte miscalculation of a buffer needed
for one of the Hobbit environment variables. This patch should solve it.


Regards,
Henrik

-------------- next part --------------
--- common/bbcmd.c	2006/07/09 15:15:52	1.20
+++ common/bbcmd.c	2006/08/05 20:38:29
@@ -42,7 +42,7 @@
 		}
 		else strcpy(buf, "localhost");
 -		evar = (char *)malloc(strlen(buf) + 12);
+		evar = (char *)malloc(strlen(buf) + 13);
 		sprintf(evar, "MACHINEDOTS=%s", buf);
 		putenv(evar);
 	}