aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_smtp.c
diff options
context:
space:
mode:
authorGravatar Iustin Pop <iustin@debian.org> 2019-01-18 22:52:54 +0100
committerGravatar Jan Wagner <waja@cyconet.org> 2019-01-18 22:52:54 +0100
commit8520c643dd35bbeebbf36c7145d3f8c12dfaf70b (patch)
treede4b21fa93415440ac031880febeacd197d04bd9 /plugins/check_smtp.c
parent52373954332f517c4c52a8237dd20f5e91377128 (diff)
downloadmonitoring-plugins-8520c643dd35bbeebbf36c7145d3f8c12dfaf70b.tar.gz
Simply initializes n before it is used
When SSL is enabled, n is assigned the size of the server's second EHLO response (I think in bytes), which will usually be significantly higher than the command passed. As such, no commands are executed and no responses are checked, which - silently - defeats the desired checks and results in a success value.
Diffstat (limited to 'plugins/check_smtp.c')
-rw-r--r--plugins/check_smtp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index 0fcf4c68..d37c57c8 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -293,6 +293,7 @@ main (int argc, char **argv)
printf("%s", buffer);
}
+ n = 0;
while (n < ncommands) {
xasprintf (&cmd_str, "%s%s", commands[n], "\r\n");
my_send(cmd_str, strlen(cmd_str));