From 9698973600e639ddf0ceb0ee565d7297598486fe Mon Sep 17 00:00:00 2001 From: Benoit Maricau Date: Fri, 14 Jul 2023 14:03:52 +0200 Subject: [PATCH] minissdpc.c: fix memory allocation error No room allocated for end of strings ("\0") --- miniupnpc/src/minissdpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miniupnpc/src/minissdpc.c b/miniupnpc/src/minissdpc.c index edebb16..98c5b37 100644 --- a/miniupnpc/src/minissdpc.c +++ b/miniupnpc/src/minissdpc.c @@ -338,7 +338,7 @@ receiveDevicesFromMiniSSDPD(int s, int * error) #ifdef DEBUG printf(" usnsize=%u\n", usnsize); #endif /* DEBUG */ - tmp = (struct UPNPDev *)malloc(sizeof(struct UPNPDev)+urlsize+stsize+usnsize); + tmp = (struct UPNPDev *)malloc(sizeof(struct UPNPDev)+urlsize+stsize+usnsize+3); if(tmp == NULL) { if (error) *error = MINISSDPC_MEMORY_ERROR;