diff options
| author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2004-03-01 12:27:19 +0000 |
|---|---|---|
| committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2004-03-01 12:27:19 +0000 |
| commit | 3c81964713e4114d7f40f95e9373c24b596d1efd (patch) | |
| tree | 4c735cf76d5b94e246d60afb79969476379d9919 /plugins/check_tcp.c | |
| parent | f7c1eca1c45f77df548e426281569e0c7c0a6480 (diff) | |
| download | monitoring-plugins-3c81964713e4114d7f40f95e9373c24b596d1efd.tar.gz | |
check_tcp was returning uninitialized string with user-defined refused outcome
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@833 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_tcp.c')
| -rw-r--r-- | plugins/check_tcp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index 7bd48d1a..55ce8984 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c | |||
| @@ -206,6 +206,7 @@ main (int argc, char **argv) | |||
| 206 | server_port = PORT; | 206 | server_port = PORT; |
| 207 | server_send = SEND; | 207 | server_send = SEND; |
| 208 | server_quit = QUIT; | 208 | server_quit = QUIT; |
| 209 | status = strdup (""); | ||
| 209 | 210 | ||
| 210 | if (process_arguments (argc, argv) == ERROR) | 211 | if (process_arguments (argc, argv) == ERROR) |
| 211 | usage (_("Could not parse arguments\n")); | 212 | usage (_("Could not parse arguments\n")); |
| @@ -259,7 +260,6 @@ main (int argc, char **argv) | |||
| 259 | 260 | ||
| 260 | buffer = malloc (MAXBUF); | 261 | buffer = malloc (MAXBUF); |
| 261 | memset (buffer, '\0', MAXBUF); | 262 | memset (buffer, '\0', MAXBUF); |
| 262 | status = strdup (""); | ||
| 263 | /* watch for the expect string */ | 263 | /* watch for the expect string */ |
| 264 | while ((i = my_recv ()) > 0) { | 264 | while ((i = my_recv ()) > 0) { |
| 265 | buffer[i] = '\0'; | 265 | buffer[i] = '\0'; |
| @@ -271,7 +271,7 @@ main (int argc, char **argv) | |||
| 271 | } | 271 | } |
| 272 | 272 | ||
| 273 | /* return a CRITICAL status if we couldn't read any data */ | 273 | /* return a CRITICAL status if we couldn't read any data */ |
| 274 | if (status == NULL) | 274 | if (strlen(status) == 0) |
| 275 | die (STATE_CRITICAL, _("No data received from host\n")); | 275 | die (STATE_CRITICAL, _("No data received from host\n")); |
| 276 | 276 | ||
| 277 | strip (status); | 277 | strip (status); |
