mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-06-10 17:20:05 -04:00
`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
This commit is contained in:
parent
7c8db659a4
commit
0dc4801791
1 changed files with 2 additions and 2 deletions
|
|
@ -148,7 +148,7 @@ main (int argc, char **argv)
|
|||
|
||||
if (display_html == TRUE)
|
||||
printf ("<A HREF=\"%s://%s:%d%s\" target=\"_blank\">",
|
||||
use_ssl ? "https" : "http", host_name,
|
||||
use_ssl ? "https" : "http", server_address,
|
||||
server_port, server_url);
|
||||
|
||||
/* initialize alarm signal handling, set socket timeout, start timer */
|
||||
|
|
@ -1141,7 +1141,7 @@ redir (char *pos, char *status_line)
|
|||
}
|
||||
i = server_port;
|
||||
strcpy (type, server_type);
|
||||
strcpy (addr, host_name);
|
||||
strcpy (addr, server_address);
|
||||
}
|
||||
|
||||
else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue