Xymon Mailing List Archive search

Sigsegv in Bbtest-net

list Henrik Størner
Fri, 21 Jul 2006 16:52:09 +0200
Message-Id: <user-87972276d6a7@xymon.invalid>

On Fri, Jul 21, 2006 at 12:17:08PM +0200, Thomas Schenk wrote:
#6  0x080655e1 in addtostrbuffer (buf=0x1, newtext=0x82e5980) at
strfunc.c:124
#7  0x080629ca in addtostrstatus (p=0x1) at sendmsg.c:658
#8  0x0804eb86 in send_results (service=0x8080098, failgoesclear=1) at
bbtest-net.c:1716
#9  0x0805096c in main (argc=4, argv=0xbfbe2d74) at bbtest-net.c:2261
This is a bug which gets triggered if you do a traceroute when the
ping test fails. Patch attached.


Regards,
Henrik

-------------- next part --------------
--- bbnet/bbtest-net.c	2006/07/20 16:06:41	1.238
+++ bbnet/bbtest-net.c	2006/07/21 14:49:58
@@ -1739,7 +1739,7 @@
 			}
 		}
 
-		if ((service == pingtest) && t->host->traceroute) {
+		if ((service == pingtest) && t->host->traceroute && (STRBUFLEN(t->host->traceroute) > 0)) {
 			addtostatus("Traceroute results:\n");
 			addtostrstatus(t->host->traceroute);
 			addtostatus("\n");