[nagiosplug] Fix Debian bug #460097: check_http -M broken

Holger Weiss hweiss at users.sourceforge.net
Sun Apr 11 11:12:43 CEST 2010


 Module: nagiosplug
 Branch: master
 Commit: aef79b7f411244385151880683651c884597e4eb
 Author: Holger Weiss <holger at zedat.fu-berlin.de>
   Date: Sun Apr 11 11:05:49 2010 +0200
    URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commit;h=aef79b7

Fix Debian bug #460097: check_http -M broken

See: http://bugs.debian.org/460097

One instance of this bug has already been fixed in commit
888358122004b9571c8fbdfa52ceee1ba5e5f4f2.

(Fixed by Hilko Bengen, forwarded by Jan Wagner.)

---

 plugins/check_http.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/plugins/check_http.c b/plugins/check_http.c
index 536b400..0a8910c 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -733,7 +733,10 @@ get_content_length (const char *headers)
     /* Skip to the end of the header, including continuation lines. */
     while (*s && !(*s == '\n' && (s[1] != ' ' && s[1] != '\t')))
       s++;
-    s++;
+
+    /* Avoid stepping over end-of-string marker */
+    if (*s)
+      s++;
 
     /* Process this header. */
     if (value && value > field+2) {





More information about the Commits mailing list