* some header analyzers were still operating on old buffers; thanks to samjam for pointing this out.
char buf[SIZ];
int i, len;
- if (strncmp(ChrPtr(cookie), "webcit=", (sizeof("webcit=") - 1)) == 0)
- StrBufCutLeft(cookie, 7);
+ pch = strstr(ChrPtr(cookie), "webcit=");
+
+ if (pch != NULL)
+ StrBufCutLeft(cookie, (pch - ChrPtr(cookie)) + 7);
strcpy(buf, "");
len = StrLength(cookie) / 2;
if ((follow_xff) &&
GetHash(HTTPHeaders, HKEY("X-FORWARDED-HOST"), &vLine) &&
(vLine != NULL)) {
- safestrncpy(WCC->http_host, &buf[18], sizeof WCC->http_host);
+ safestrncpy(WCC->http_host,
+ ChrPtr((StrBuf*)vLine),
+ sizeof WCC->http_host);
}
if (IsEmptyStr(WCC->http_host) &&
GetHash(HTTPHeaders, HKEY("HOST"), &vLine) &&