From 6c2b10b1189eb558c861502379104e7b24309a6b Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Mon, 28 Oct 2019 14:42:01 -0500 Subject: [PATCH] monitor: Don't pass NULL as src to memcpy Skip the memcpy when len = 0 --- monitor/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monitor/main.c b/monitor/main.c index 020dba86..41692cd1 100644 --- a/monitor/main.c +++ b/monitor/main.c @@ -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); }