laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/27988 )
Change subject: octoi: only memcpy() if it is present in _octoi_tx_echo() ......................................................................
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 --- M src/octoi/octoi_sock.c 1 file changed, 2 insertions(+), 1 deletion(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/src/octoi/octoi_sock.c b/src/octoi/octoi_sock.c index 4245d80..eac07ee 100644 --- a/src/octoi/octoi_sock.c +++ b/src/octoi/octoi_sock.c @@ -130,7 +130,8 @@ } 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;
1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one.