layer23/l1ctl.c: fix: verify msg length against l1ctl_hdr

In l1ctl_recv() we actually expect to 'see' the L1CTL header
instead of the DL info header. Let's fix this.

Change-Id: Ic7d017bef04f3c186565d5dade36959df1019bd8
This commit is contained in:
Vadim Yanitskiy 2018-10-03 06:14:12 +07:00
parent 5746125696
commit 7c04a6066e
1 changed files with 1 additions and 2 deletions

View File

@ -873,9 +873,8 @@ int l1ctl_recv(struct osmocom_ms *ms, struct msgb *msg)
{
int rc = 0;
struct l1ctl_hdr *l1h;
struct l1ctl_info_dl *dl;
if (msgb_l2len(msg) < sizeof(*dl)) {
if (msgb_l2len(msg) < sizeof(*l1h)) {
LOGP(DL1C, LOGL_ERROR, "Short Layer2 message: %u\n",
msgb_l2len(msg));
msgb_free(msg);