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
1 changed files with 2 additions and 1 deletions

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);
}