1
0
Fork 0
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:
Andy Green 2021-09-14 05:58:53 +01:00
parent e502a5fb44
commit b5ae1e3b5a
2 changed files with 2 additions and 2 deletions

View file

@ -95,7 +95,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_warn("%s: OOM\n", __func__);
return 1;

View file

@ -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;