minissdpc.c: fix memory allocation error

No room allocated for end of strings ("\0")
This commit is contained in:
Benoit Maricau 2023-07-14 14:03:52 +02:00
parent a765292fd7
commit 9698973600
1 changed files with 1 additions and 1 deletions

View File

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