diff options
author | Holger Weiss <hweiss@users.sourceforge.net> | 2007-06-01 23:08:24 +0000 |
---|---|---|
committer | Holger Weiss <hweiss@users.sourceforge.net> | 2007-06-01 23:08:24 +0000 |
commit | 61e0cbb7f4ef75d95c9010bea7c99c3ab8e861f5 (patch) | |
tree | 541ae158459c6fb95c1ef369f8a95f524dc0ec3b | |
parent | f71de78952ff36860e1a4a423d3d3f03c4714488 (diff) | |
download | monitoring-plugins-61e0cbb7f4ef75d95c9010bea7c99c3ab8e861f5.tar.gz |
Fix an off-by-one error where a realloc(3) call doesn't allocate space
for nul-termination (Aravind Gottipati - 1729692)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1727 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r-- | plugins/check_http.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c index 5e33ec86..86e18dec 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c | |||
@@ -1101,7 +1101,7 @@ redir (char *pos, char *status_line) | |||
1101 | pos += i; | 1101 | pos += i; |
1102 | pos += strspn (pos, " \t\r\n"); | 1102 | pos += strspn (pos, " \t\r\n"); |
1103 | 1103 | ||
1104 | url = realloc (url, strcspn (pos, "\r\n")); | 1104 | url = realloc (url, strcspn (pos, "\r\n") + 1); |
1105 | if (url == NULL) | 1105 | if (url == NULL) |
1106 | die (STATE_UNKNOWN, _("HTTP UNKNOWN - could not allocate url\n")); | 1106 | die (STATE_UNKNOWN, _("HTTP UNKNOWN - could not allocate url\n")); |
1107 | 1107 | ||