Merge pull request #666 from ben-31/fix_malloc_error

minissdpc.c: fix memory allocation error
This commit is contained in:
Thomas BERNARD 2023-11-15 00:22:28 +01:00 committed by GitHub
commit a5fd382e95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;