From 5e860953643f5adc884e2e4f681802765098cb4e Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 18 Apr 2010 02:41:20 +0800 Subject: nat: Always initialize the out pointer... Always initialize the pointer to a invalid value in case we encounter a parsing error or such. --- openbsc/src/nat/bsc_nat_utils.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'openbsc/src/nat') diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c index f2940a55c..290ee4eaa 100644 --- a/openbsc/src/nat/bsc_nat_utils.c +++ b/openbsc/src/nat/bsc_nat_utils.c @@ -112,6 +112,8 @@ struct bsc_connection *bsc_nat_find_bsc(struct bsc_nat *nat, struct msgb *msg, i struct tlv_parsed tp; int i = 0; + *lac_out = -1; + if (!msg->l3h || msgb_l3len(msg) < 3) { LOGP(DNAT, LOGL_ERROR, "Paging message is too short.\n"); return NULL; -- cgit v1.2.3