summaryrefslogtreecommitdiffstats
path: root/plugins/utils.h
diff options
context:
space:
mode:
authorSven Nierlein <sven@nierlein.de>2019-04-25 11:03:10 (GMT)
committerSven Nierlein <sven@nierlein.org>2019-05-24 12:51:10 (GMT)
commite8325b39c47e6fbf7c8c1e31f9026870d9520af5 (patch)
tree1c55421a51808253cbe59348e45bd0cb580354c5 /plugins/utils.h
parent4131f2f268e7d771490ebeadbae50b4f95d69695 (diff)
downloadmonitoring-plugins-e8325b3.tar.gz
fix maxfd being zero
If _SC_OPEN_MAX is available then maxfd was zero initialized and never set to the value from sysconf. This leads to segfaults with free(): invalid size introduced by commit 7cafb0e84550035fe671662c293122be975065ca. Signed-off-by: Sven Nierlein <sven@nierlein.de>
Diffstat (limited to 'plugins/utils.h')
-rw-r--r--plugins/utils.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/utils.h b/plugins/utils.h
index 6aa316f..33a2054 100644
--- a/plugins/utils.h
+++ b/plugins/utils.h
@@ -97,6 +97,8 @@ char *sperfdata (const char *, double, const char *, char *, char *,
97char *sperfdata_int (const char *, int, const char *, char *, char *, 97char *sperfdata_int (const char *, int, const char *, char *, char *,
98 int, int, int, int); 98 int, int, int, int);
99 99
100int open_max (void);
101
100/* The idea here is that, although not every plugin will use all of these, 102/* The idea here is that, although not every plugin will use all of these,
101 most will or should. Therefore, for consistency, these very common 103 most will or should. Therefore, for consistency, these very common
102 options should have only these meanings throughout the overall suite */ 104 options should have only these meanings throughout the overall suite */