aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/core-net/client/conmon.c2
-rw-r--r--lib/system/async-dns/async-dns-parse.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/core-net/client/conmon.c b/lib/core-net/client/conmon.c
index 0fb716bd..21f67c96 100644
--- a/lib/core-net/client/conmon.c
+++ b/lib/core-net/client/conmon.c
@@ -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;
diff --git a/lib/system/async-dns/async-dns-parse.c b/lib/system/async-dns/async-dns-parse.c
index cc9693ab..17e95aa2 100644
--- a/lib/system/async-dns/async-dns-parse.c
+++ b/lib/system/async-dns/async-dns-parse.c
@@ -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;