diff options
author | Holger Weiss <hweiss@users.sourceforge.net> | 2007-06-15 18:31:37 +0000 |
---|---|---|
committer | Holger Weiss <hweiss@users.sourceforge.net> | 2007-06-15 18:31:37 +0000 |
commit | 0dc4801791d956c3d4d2059b6fcdd249fe152df5 (patch) | |
tree | d34ddfaa9c25500af400a8d37ca04786e89bccae /plugins/check_http.c | |
parent | 7c8db659a49d575b6d5b0304f5399c9b2931d83b (diff) | |
download | monitoring-plugins-0dc4801791d956c3d4d2059b6fcdd249fe152df5.tar.gz |
`host_name' is a NULL pointer if the "-I" flag is used instead of "-H",
so use `server_address' instead. Fixes a possible segfault when
following redirects to relative URLs (reported by Ingo Lantschner).
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1740 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r-- | plugins/check_http.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c index 86e18dec..f2f7a18a 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c | |||
@@ -148,7 +148,7 @@ main (int argc, char **argv) | |||
148 | 148 | ||
149 | if (display_html == TRUE) | 149 | if (display_html == TRUE) |
150 | printf ("<A HREF=\"%s://%s:%d%s\" target=\"_blank\">", | 150 | printf ("<A HREF=\"%s://%s:%d%s\" target=\"_blank\">", |
151 | use_ssl ? "https" : "http", host_name, | 151 | use_ssl ? "https" : "http", server_address, |
152 | server_port, server_url); | 152 | server_port, server_url); |
153 | 153 | ||
154 | /* initialize alarm signal handling, set socket timeout, start timer */ | 154 | /* initialize alarm signal handling, set socket timeout, start timer */ |
@@ -1141,7 +1141,7 @@ redir (char *pos, char *status_line) | |||
1141 | } | 1141 | } |
1142 | i = server_port; | 1142 | i = server_port; |
1143 | strcpy (type, server_type); | 1143 | strcpy (type, server_type); |
1144 | strcpy (addr, host_name); | 1144 | strcpy (addr, server_address); |
1145 | } | 1145 | } |
1146 | 1146 | ||
1147 | else { | 1147 | else { |