diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2003-02-21 21:59:17 (GMT) |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2003-02-21 21:59:17 (GMT) |
commit | 2efb3099a54cac2c26fa925b430df80ace19d7de (patch) | |
tree | 89bb2277a834e052a29005305316bf7c9092c274 /plugins | |
parent | 782bc207d5697f539beb1fd3359ce81d22e26a54 (diff) | |
download | monitoring-plugins-2efb3099a54cac2c26fa925b430df80ace19d7de.tar.gz |
Fixed coredump with unallocated string
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@351 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_http.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c index 8ffbf98..856acde 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c | |||
@@ -203,8 +203,8 @@ char server_port_text[6] = ""; | |||
203 | char server_type[6] = "http"; | 203 | char server_type[6] = "http"; |
204 | char *server_address = ""; | 204 | char *server_address = ""; |
205 | char *host_name = ""; | 205 | char *host_name = ""; |
206 | char *server_url = HTTP_URL; | 206 | char *server_url = ""; |
207 | int server_url_length = 1; | 207 | int server_url_length; |
208 | int server_expect_yn = 0; | 208 | int server_expect_yn = 0; |
209 | char server_expect[MAX_INPUT_BUFFER] = HTTP_EXPECT; | 209 | char server_expect[MAX_INPUT_BUFFER] = HTTP_EXPECT; |
210 | char string_expect[MAX_INPUT_BUFFER] = ""; | 210 | char string_expect[MAX_INPUT_BUFFER] = ""; |
@@ -235,6 +235,10 @@ main (int argc, char **argv) | |||
235 | { | 235 | { |
236 | int result = STATE_UNKNOWN; | 236 | int result = STATE_UNKNOWN; |
237 | 237 | ||
238 | /* Set default URL. Must be malloced for subsequent realloc if --onredirect=follow */ | ||
239 | asprintf (&server_url, "%s", HTTP_URL); | ||
240 | server_url_length = strlen(server_url); | ||
241 | |||
238 | if (process_arguments (argc, argv) == ERROR) | 242 | if (process_arguments (argc, argv) == ERROR) |
239 | usage ("check_http: could not parse arguments\n"); | 243 | usage ("check_http: could not parse arguments\n"); |
240 | 244 | ||