mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Fix ParseHttpMessage failing to store >2 repeatable headers (#657)
This commit is contained in:
parent
e557058ac8
commit
84b9b8ed87
2 changed files with 31 additions and 4 deletions
|
@ -236,8 +236,12 @@ int ParseHttpMessage(struct HttpMessage *r, const char *p, size_t n) {
|
|||
unsigned c2;
|
||||
struct HttpHeader *p1, *p2;
|
||||
p1 = r->xheaders.p;
|
||||
c2 = r->xheaders.c + 2;
|
||||
c2 = c2 >> 1;
|
||||
c2 = r->xheaders.c;
|
||||
if (c2 == 0) {
|
||||
c2 = 1;
|
||||
} else {
|
||||
c2 = c2 * 2;
|
||||
}
|
||||
if ((p2 = realloc(p1, c2 * sizeof(*p1)))) {
|
||||
r->xheaders.p = p2;
|
||||
r->xheaders.c = c2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue