Commit 0e0c6b83 authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by Cesanta Bot

Fix off-by one

cesanta/mongoose#677

PUBLISHED_FROM=4b62bdefac08fa3bedf511dc4d6f7463af3325fc
parent 6f17f3e2
...@@ -7066,7 +7066,7 @@ static int mg_http_common_url_parse(const char *url, const char *schema, ...@@ -7066,7 +7066,7 @@ static int mg_http_common_url_parse(const char *url, const char *schema,
} }
while (*url != '\0') { while (*url != '\0') {
*addr = (char *) MG_REALLOC(*addr, addr_len + 5 /* space for port too. */); *addr = (char *) MG_REALLOC(*addr, addr_len + 6 /* space for port too. */);
if (*addr == NULL) { if (*addr == NULL) {
DBG(("OOM")); DBG(("OOM"));
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment