]> err.no Git - varnish/commitdiff
Don't allow len to go negative if the header is empty.
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 17 Jun 2007 15:10:08 +0000 (15:10 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 17 Jun 2007 15:10:08 +0000 (15:10 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1531 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishncsa/varnishncsa.c

index 926422927f13acafca69320d6dd0322cf7b5d3b9..68a891fec1105b213ff820c68597c16aa07aa61b 100644 (file)
@@ -155,7 +155,7 @@ trimline(const char *str, const char *end)
                 /* nothing */ ;
 
        /* trim trailing space */
-       while (str[len - 1] == ' ')
+       while (len && str[len - 1] == ' ')
                --len;
 
        /* copy and return */