[hobbit] hobbit-mailack Segmentation fault

Henrik Stoerner henrik at hswn.dk
Mon Jul 17 11:39:57 CEST 2006


On Mon, Jul 17, 2006 at 08:33:17AM +0200, Peter wrote:
> Hi,
> 
> Running on a debian sarge, I tried the beta and the RC, but when I try 
> to use the hobbit-mailack I get an segmentation fault.
> Any ideas??

Try feeding it a real mail. I.e. input with a "From" and "Subject"
header, followed by a blank line, and then some text.

It shouldn't crash, though - the attached patch should fix that.


Regards,
Henrik

-------------- next part --------------
--- hobbitd/hobbit-mailack.c	2006/05/19 12:02:55	1.17
+++ hobbitd/hobbit-mailack.c	2006/07/17 09:38:51
@@ -12,7 +12,7 @@
 /*                                                                            */
 /*----------------------------------------------------------------------------*/
 
-static char rcsid[] = "$Id: hobbit-mailack.c,v 1.17 2006/05/19 12:02:55 henrik Exp $";
+static char rcsid[] = "$Id: hobbit-mailack.c,v 1.18 2006/07/17 09:38:45 henrik Exp $";
 
 #include <ctype.h>
 #include <stdio.h>
@@ -152,6 +152,7 @@
 
 	/* Setup the acknowledge message */
 	if (duration == 0) duration = 60;	/* Default: Ack for 60 minutes */
+	if (firsttxtline == NULL) firsttxtline = "<No cause specified>";
 	ackbuf = (char *)malloc(4096 + strlen(firsttxtline) + (fromline ? strlen(fromline) : 0));
 	p = ackbuf;
 	p += sprintf(p, "hobbitdack %s %d %s", cookie, duration, firsttxtline);


More information about the Xymon mailing list