Don't pass a NULL pointer to memcpy
The memcpy and related functions expects a valid pointer, even if the size is zero. Most libc implementations will handle a NULL pointer just fine, but that's not guaranteed. Simply skip the call when there is nothing to copy.
This commit is contained in:
parent
c5813d624a
commit
3d388a0a96
@ -163,7 +163,9 @@ deepsix_excursion_recv (deepsix_excursion_device_t *device, unsigned char grp, u
|
|||||||
return DC_STATUS_PROTOCOL;
|
return DC_STATUS_PROTOCOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(data, packet + 4, len);
|
if (len) {
|
||||||
|
memcpy(data, packet + 4, len);
|
||||||
|
}
|
||||||
|
|
||||||
if (actual)
|
if (actual)
|
||||||
*actual = len;
|
*actual = len;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user