Răsfoiți Sursa

check_snmp: Fix segfault when multiple arguments passed to -o and the first is timeticks. Revert semicolon insertion on arguments passed to -o

madlohe 6 ani în urmă
părinte
comite
000dc69d09
1 a modificat fișierele cu 1 adăugiri și 5 ștergeri
  1. 1 5
      plugins/check_snmp.c

+ 1 - 5
plugins/check_snmp.c

@@ -412,6 +412,7 @@ main (int argc, char **argv)
 		bzero(type, sizeof(type));
 
 		is_counter=0;
+		is_ticks = 0;
 		/* We strip out the datatype indicator for PHBs */
 		if (strstr (response, "Gauge: ")) {
 			show = strstr (response, "Gauge: ") + 7;
@@ -573,11 +574,6 @@ main (int argc, char **argv)
 			xasprintf (&outbuff, "%s%s%s%s%s", outbuff, (i == 0) ? " " : output_delim,
 				mark (iresult), show, mark (iresult));
 
-		/* Add a semicolon to separate multiple oids */
-		if(outbuff != NULL && line != chld_out.lines-1) {
-			xasprintf (&outbuff, "%s;", outbuff);
-		}
-				
 		/* Append a unit string for this OID if there is one */
 		if (nunits > (size_t)0 && (size_t)i < nunits && unitv[i] != NULL)
 			xasprintf (&outbuff, "%s %s", outbuff, unitv[i]);