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 b6004e08c9
commit d069098683
2 changed files with 2 additions and 2 deletions

View file

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

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;