mirror of https://gerrit.osmocom.org/libosmocore
lapd_test: avoid calling memcpy with NULL source
fixes lapd/lapd_test.c:54:2: runtime error: null pointer passed as argument 2, which is declared to never be null Change-Id: I7030729f4f4c867adecc7afc15bb5ca9beff0030
This commit is contained in:
parent
6cfa56ba0c
commit
53e2672e11
|
@ -51,7 +51,8 @@ static struct msgb *msgb_from_array(const uint8_t *data, int len)
|
|||
{
|
||||
struct msgb *msg = msgb_alloc_headroom(4096, 128, "data");
|
||||
msg->l3h = msgb_put(msg, len);
|
||||
memcpy(msg->l3h, data, len);
|
||||
if (data && len)
|
||||
memcpy(msg->l3h, data, len);
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue