aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-10-14 17:21:04 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-10-14 22:05:34 +0200
commit949e0ba648ab0e8173ed4755e0158966acd1efc2 (patch)
tree6572852e96a56763a251304142f55a550a1e66ae
parent69cfa179ef9a1ae787b4e8134cfaef670cd31095 (diff)
ipaccess: memset the tlv_parsed structure before parsing
Make sure the tlv_parsed structure is initialized properly, otherwise we might detect a tag that should not be present.
-rw-r--r--openbsc/src/input/ipaccess.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/openbsc/src/input/ipaccess.c b/openbsc/src/input/ipaccess.c
index 4968e8093..74c850c9f 100644
--- a/openbsc/src/input/ipaccess.c
+++ b/openbsc/src/input/ipaccess.c
@@ -101,6 +101,8 @@ int ipaccess_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len)
u_int8_t t_tag;
u_int8_t *cur = buf;
+ memset(dec, 0, sizeof(*dec));
+
while (cur < buf + len) {
t_len = *cur++;
t_tag = *cur++;