GSM 08.08: Fix generation of CIPHER MODE REJECT
authorHarald Welte <laforge@gnumonks.org>
Mon, 11 Jul 2011 22:02:09 +0000 (00:02 +0200)
committerHarald Welte <laforge@gnumonks.org>
Mon, 11 Jul 2011 22:02:27 +0000 (00:02 +0200)
The message has a total length of 4 octets, so don't allocate only 3 in the
msgb.

src/gsm/gsm0808.c

index 9cd70a0..eae1598 100644 (file)
@@ -159,7 +159,7 @@ struct msgb *gsm0808_create_cipher_reject(uint8_t cause)
        if (!msg)
                return NULL;
 
-       msg->l3h = msgb_put(msg, 3);
+       msg->l3h = msgb_put(msg, 4);
        msg->l3h[0] = BSSAP_MSG_BSS_MANAGEMENT;
        msg->l3h[1] = 2;
        msg->l3h[2] = BSS_MAP_MSG_CIPHER_MODE_REJECT;