diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2016-01-12 09:46:21 +0100 |
---|---|---|
committer | Daniel Willmann <dwillmann@sysmocom.de> | 2016-01-12 09:46:21 +0100 |
commit | 86a14053d89999b0b43467e4e0d5eb1d033c9b52 (patch) | |
tree | b62e18deaada36f7b74c0601e63ff49ea85aa3a9 | |
parent | a2be99e585a24d1820b008107013a85cad561e5d (diff) |
asn1tostruct.py: Zero IEs_t target struct in decode function
-rwxr-xr-x | asn1/utils/asn1tostruct.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/asn1/utils/asn1tostruct.py b/asn1/utils/asn1tostruct.py index 5b0e737..d1b5292 100755 --- a/asn1/utils/asn1tostruct.py +++ b/asn1/utils/asn1tostruct.py @@ -296,6 +296,7 @@ for key in iesDefs: f.write(" assert(any_p != NULL);\n") if len(iesDefs[key]["ies"]) != 0: f.write(" assert(%s != NULL);\n\n" % (lowerFirstCamelWord(re.sub('-', '_', key)))) + f.write(" memset(%s, 0, sizeof(%s_t));\n" % (lowerFirstCamelWord(re.sub('-', '_', key)), prefix + re.sub('-', '_', key))) f.write(" %s_DEBUG(\"Decoding message %s (%%s:%%d)\\n\", __FILE__, __LINE__);\n\n" % (fileprefix.upper(), prefix + re.sub('-', '_', keyName))) f.write(" ANY_to_type_aper(any_p, &asn_DEF_%s, (void**)&%s_p);\n\n" % (asn1cStruct, asn1cStructfirstlower)) |