From: <buc...@us...> - 2008-11-07 00:25:52
|
Revision: 90 http://devmon.svn.sourceforge.net/devmon/?rev=90&view=rev Author: buchanmilne Date: 2008-11-07 00:25:45 +0000 (Fri, 07 Nov 2008) Log Message: ----------- Fix segfault in hobbitd_rrd caused by do_devmon.c and data with spaces in repeater names Modified Paths: -------------- trunk/extras/do_devmon.c trunk/extras/hobbit-4.2.0-devmon-complete.patch Modified: trunk/extras/do_devmon.c =================================================================== --- trunk/extras/do_devmon.c 2008-09-04 08:15:59 UTC (rev 89) +++ trunk/extras/do_devmon.c 2008-11-07 00:25:45 UTC (rev 90) @@ -63,6 +63,7 @@ devmon_params[numds+2] = xstrdup(columns[numds]); numds++; } + dbgprintf("Found %d DS definitions\n",numds); devmon_params[numds+2] = rra1; devmon_params[numds+3] = rra2; devmon_params[numds+4] = rra3; @@ -72,8 +73,13 @@ if (devmon_tpl == NULL) devmon_tpl = setup_template(devmon_params); goto nextline; } - dbgprintf("Found %d DS definitions\n",numds); + dbgprintf("Found %d columns in devmon rrd data\n",columncount); + if (columncount > 2) { + dbgprintf("Skipping line, found %d (max 2) columns in devmon rrd data, space in repeater name?\n",columncount); + goto nextline; + } + /* Now we should be on to values: * eth0.0 4678222:9966777 */ Modified: trunk/extras/hobbit-4.2.0-devmon-complete.patch =================================================================== --- trunk/extras/hobbit-4.2.0-devmon-complete.patch 2008-09-04 08:15:59 UTC (rev 89) +++ trunk/extras/hobbit-4.2.0-devmon-complete.patch 2008-11-07 00:25:45 UTC (rev 90) @@ -94,9 +94,9 @@ /* CGI params */ static char *hostname = NULL; ---- hobbit-4.2.0/hobbitd/rrd/do_devmon.c.orig 2008-04-03 11:02:48.000000000 +0200 -+++ hobbit-4.2.0/hobbitd/rrd/do_devmon.c 2008-02-01 09:11:17.000000000 +0200 -@@ -0,0 +1,104 @@ +--- hobbit-4.2.0/hobbitd/rrd/do_devmon.c.orig 2008-11-07 02:20:09.000000000 +0200 ++++ hobbit-4.2.0/hobbitd/rrd/do_devmon.c 2008-11-07 02:19:23.000000000 +0200 +@@ -0,0 +1,110 @@ +/*----------------------------------------------------------------------------*/ +/* Hobbit RRD handler module for Devmon */ +/* */ @@ -162,6 +162,7 @@ + devmon_params[numds+2] = xstrdup(columns[numds]); + numds++; + } ++ dbgprintf("Found %d DS definitions\n",numds); + devmon_params[numds+2] = rra1; + devmon_params[numds+3] = rra2; + devmon_params[numds+4] = rra3; @@ -171,8 +172,13 @@ + if (devmon_tpl == NULL) devmon_tpl = setup_template(devmon_params); + goto nextline; + } -+ dbgprintf("Found %d DS definitions\n",numds); + ++ dbgprintf("Found %d columns in devmon rrd data\n",columncount); ++ if (columncount > 2) { ++ dbgprintf("Skipping line, found %d (max 2) columns in devmon rrd data, space in repeater name?\n",columncount); ++ goto nextline; ++ } ++ + /* Now we should be on to values: + * eth0.0 4678222:9966777 + */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |