minissdpc.c: fix memory allocation error
No room allocated for end of strings ("\0")
This commit is contained in:
parent
a765292fd7
commit
9698973600
|
@ -338,7 +338,7 @@ receiveDevicesFromMiniSSDPD(int s, int * error)
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf(" usnsize=%u\n", usnsize);
|
printf(" usnsize=%u\n", usnsize);
|
||||||
#endif /* DEBUG */
|
#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(tmp == NULL) {
|
||||||
if (error)
|
if (error)
|
||||||
*error = MINISSDPC_MEMORY_ERROR;
|
*error = MINISSDPC_MEMORY_ERROR;
|
||||||
|
|
Loading…
Reference in New Issue