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 dcf8a7db43
commit ea8cbd5e72
1 changed files with 7 additions and 0 deletions

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));