nat: Add size check for the payload

The msgb will always have these bytes but it is better practice
to verify that the message really has space for the two bytes.
This commit is contained in:
Holger Hans Peter Freyther 2015-06-08 18:31:02 +02:00
parent 57ee780789
commit 2dd18bdd87
1 changed files with 1 additions and 1 deletions

View File

@ -1185,7 +1185,7 @@ exit:
send_reset_ack(bsc);
} else if (parsed->ipa_proto == IPAC_PROTO_IPACCESS) {
/* do we know who is handling this? */
if (msg->l2h[0] == IPAC_MSGT_ID_RESP) {
if (msg->l2h[0] == IPAC_MSGT_ID_RESP && msgb_l2len(msg) > 2) {
struct tlv_parsed tvp;
int ret;
ret = ipa_ccm_idtag_parse(&tvp,