octoi: only memcpy() if it is present in _octoi_tx_echo()
If the caller specifies zero-length data or a NULL pointer, don't attempt to call memcpy() on that. Change-Id: I5f5ed937643162d6ef6ce0cf2908432c007943c1
This commit is contained in:
parent
0d813b5947
commit
18a05ecd7c
|
@ -130,7 +130,8 @@ static int _octoi_tx_echo(struct octoi_peer *peer, bool is_req, uint16_t seq_nr,
|
|||
} u;
|
||||
|
||||
u.echo.seq_nr = htons(seq_nr);
|
||||
memcpy(u.echo.data, data, data_len);
|
||||
if (data && data_len)
|
||||
memcpy(u.echo.data, data, data_len);
|
||||
|
||||
if (is_req)
|
||||
msgt = E1OIP_MSGT_ECHO_REQ;
|
||||
|
|
Loading…
Reference in New Issue