summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2003-07-03 16:49:14 +0000
committerTon Voon <tonvoon@users.sourceforge.net>2003-07-03 16:49:14 +0000
commitde2773d48510f3ef7908e341446bc2b72c0b7969 (patch)
tree4a163c6a9cef7d33210f067c13a73c84db9455d2
parent1ca485eb821cd388270a996318e3ac9a8c9f9728 (diff)
downloadmonitoring-plugins-de2773d48510f3ef7908e341446bc2b72c0b7969.tar.gz
Fixed seg fault on some Sol 7/8 servers (Patch 764745 - Alexander Matey)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@585 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--plugins/check_procs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index 737a87b1..ccf0891d 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -204,11 +204,15 @@ main (int argc, char **argv)
204 /* Zombie processes do not give a procprog command */ 204 /* Zombie processes do not give a procprog command */
205 if ( cols == 6 && strstr(procstat, zombie) ) { 205 if ( cols == 6 && strstr(procstat, zombie) ) {
206 cols = 7; 206 cols = 7;
207 /* Set some value for procargs for the strip command further below
208 Seen to be a problem on some Solaris 7 and 8 systems */
209 input_buffer[pos] = '\n';
210 input_buffer[pos+1] = 0x0;
207 } 211 }
208 if ( cols >= 7 ) { 212 if ( cols >= 7 ) {
209 resultsum = 0; 213 resultsum = 0;
210 asprintf (&procargs, "%s", input_buffer + pos); 214 asprintf (&procargs, "%s", input_buffer + pos);
211 strip (procargs); 215 strip (procargs);
212 216
213 if ((options & STAT) && (strstr (statopts, procstat))) 217 if ((options & STAT) && (strstr (statopts, procstat)))
214 resultsum |= STAT; 218 resultsum |= STAT;