diff options
author | Holger Weiss <hweiss@users.sourceforge.net> | 2007-10-14 22:19:29 +0000 |
---|---|---|
committer | Holger Weiss <hweiss@users.sourceforge.net> | 2007-10-14 22:19:29 +0000 |
commit | b9548623f811473f6624f0f286625486e444eb29 (patch) | |
tree | cd8876b3c7627bbd965dbffa4153ea7b1a166c20 /plugins/check_http.c | |
parent | 474d1713cee4227f133e416192760e1aa8632ee2 (diff) | |
download | monitoring-plugins-b9548623f811473f6624f0f286625486e444eb29.tar.gz |
Fix a possible segfault if using "-f follow" and the server sends a
forged "LLLLocation" header prefixed with multiple "L"s (fabiodds -
1813346)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1807 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r-- | plugins/check_http.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c index 24819359..901f6b66 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c @@ -1062,7 +1062,6 @@ check_http (void) /* per RFC 2396 */ -#define HDR_LOCATION "%*[Ll]%*[Oo]%*[Cc]%*[Aa]%*[Tt]%*[Ii]%*[Oo]%*[Nn]: " #define URI_HTTP "%5[HTPShtps]" #define URI_HOST "%255[-.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]" #define URI_PORT "%6d" /* MAX_PORT's width is 5 chars, 6 to detect overflow */ @@ -1092,7 +1091,7 @@ redir (char *pos, char *status_line) die (STATE_UNKNOWN, _("HTTP UNKNOWN - Could not allocate url\n")); while (pos) { - sscanf (pos, "%[Ll]%*[Oo]%*[Cc]%*[Aa]%*[Tt]%*[Ii]%*[Oo]%*[Nn]:%n", xx, &i); + sscanf (pos, "%1[Ll]%*1[Oo]%*1[Cc]%*1[Aa]%*1[Tt]%*1[Ii]%*1[Oo]%*1[Nn]:%n", xx, &i); if (i == 0) { pos += (size_t) strcspn (pos, "\r\n"); pos += (size_t) strspn (pos, "\r\n"); |