mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
conmon: async-dns: off-by-one
This commit is contained in:
parent
b6004e08c9
commit
d069098683
2 changed files with 2 additions and 2 deletions
|
@ -96,7 +96,7 @@ lws_conmon_append_copy_new_dns_results(struct lws *wsi,
|
|||
size_t cl = cai->ai_canonname ?
|
||||
strlen(cai->ai_canonname) + 1 : 0;
|
||||
|
||||
ai = lws_malloc(al + cl, __func__);
|
||||
ai = lws_malloc(al + cl + 1, __func__);
|
||||
if (!ai) {
|
||||
lwsl_wsi_warn(wsi, "OOM");
|
||||
return 1;
|
||||
|
|
|
@ -603,7 +603,7 @@ lws_adns_parse_udp(lws_async_dns_t *dns, const uint8_t *pkt, size_t len)
|
|||
|
||||
lwsl_info("%s: create cache entry for %s, %zu\n", __func__, nm,
|
||||
est - sizeof(lws_adns_cache_t));
|
||||
c = lws_malloc(est, "async-dns-entry");
|
||||
c = lws_malloc(est + 1, "async-dns-entry");
|
||||
if (!c) {
|
||||
lwsl_err("%s: OOM %zu\n", __func__, est);
|
||||
goto fail_out;
|
||||
|
|
Loading…
Add table
Reference in a new issue