From 949e0ba648ab0e8173ed4755e0158966acd1efc2 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 14 Oct 2010 17:21:04 +0200 Subject: 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. --- openbsc/src/input/ipaccess.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'openbsc') 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++; -- cgit v1.2.3