summaryrefslogtreecommitdiffstats
path: root/tests/lapd
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lapd')
-rw-r--r--tests/lapd/lapd_test.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/lapd/lapd_test.c b/tests/lapd/lapd_test.c
index 18ea1dc3..e3223143 100644
--- a/tests/lapd/lapd_test.c
+++ b/tests/lapd/lapd_test.c
@@ -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;
}