* set correct buffer end pointer, so we don't run into unknown ground
authorWilfried Göesgens <willi@citadel.org>
Wed, 18 Nov 2009 23:00:29 +0000 (23:00 +0000)
committerWilfried Göesgens <willi@citadel.org>
Wed, 18 Nov 2009 23:00:29 +0000 (23:00 +0000)
webcit/context_loop.c

index 43adf38dd536b6eed464f2c850599b9486687e93..e0577d7eb4585aa4b720a69d08135aba51c6dc03 100644 (file)
@@ -411,9 +411,10 @@ int ReadHTTPRequest (ParsedHttpHdrs *Hdr)
                StrBufExtract_token(HeaderName, Line, 0, ':');
 
                pchs = ChrPtr(Line);
+               pche = pchs + StrLength(Line);
                pch = pchs + StrLength(HeaderName) + 1;
                pche = pchs + StrLength(Line);
-               while (isspace(*pch) && (pch < pche))
+               while ((pch < pche) && isspace(*pch))
                        pch ++;
                StrBufCutLeft(Line, pch - pchs);