make sure we advance the host buffer properly

This commit is contained in:
Joris Vink 2013-05-02 12:11:56 +02:00
parent f1fa108f98
commit 53cbc1a21e
1 changed files with 3 additions and 1 deletions

View File

@ -292,11 +292,13 @@ http_header_recv(struct netbuf *nb)
return (KORE_RESULT_ERROR);
}
if (strlen(host[0]) != 4 || strncasecmp(host[0], "host", 4)) {
if (strlen(host[0]) != 4 || strncasecmp(host[0], "host", 4) ||
strlen(host[1]) < 3) {
free(hbuf);
return (KORE_RESULT_ERROR);
}
host[1]++;
if (!http_request_new(c, NULL, host[1], request[0], request[1], &req)) {
free(hbuf);
return (KORE_RESULT_ERROR);