mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-09 16:21:45 +00:00
Check header table bounds
This commit is contained in:
1 parent
53d2356472
commit
07e580d956
3 files changed
+25
-2
No files matched your search
@@ -265,6 +265,12 @@ static bool mg_http_parse_headers(const char *s, const char *end,
|
||||
// MG_INFO(("--HH [%.*s] [%.*s]", (int) k.len, k.buf, (int) v.len, v.buf));
|
||||
h[i].name = k, h[i].value = v; // Success. Assign values
|
||||
}
|
||||
if (i == max_hdrs &&
|
||||
!(s < end &&
|
||||
(s[0] == '\n' ||
|
||||
(s[0] == '\r' && s + 1 < end && s[1] == '\n')))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user