3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-21 22:09:23 +01:00

monitor: Don't pass NULL as src to memcpy

Skip the memcpy when len = 0
This commit is contained in:
Will Dietz 2019-10-28 14:42:01 -05:00 committed by Denis Kenzior
parent 37e6f6f08b
commit 6c2b10b118

View File

@ -176,7 +176,8 @@ static size_t rta_add(void *rta_buf, unsigned short type, uint16_t len,
rta->rta_len = rta_len;
rta->rta_type = type;
memcpy(RTA_DATA(rta), data, len);
if (len)
memcpy(RTA_DATA(rta), data, len);
return RTA_SPACE(len);
}