nat: Compare the IPA size with the actual size of the data...

One sanity check that was needed in my test case..
This commit is contained in:
Holger Hans Peter Freyther
2010-03-29 14:58:43 +02:00
parent 5f1b7c14f5
commit e09348d366

View File

@@ -93,6 +93,13 @@ struct bsc_nat_parsed* bsc_nat_parse(struct msgb *msg)
msg->l2h = &hh->data[0];
/* do a size check on the input */
if (ntohs(hh->len) != msgb_l2len(msg)) {
LOGP(DINP, LOGL_ERROR, "Wrong input length?\n");
talloc_free(parsed);
return NULL;
}
/* analyze sccp down here */
if (parsed->ipa_proto == IPAC_PROTO_SCCP) {
memset(&result, 0, sizeof(result));