diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-11-13 10:51:14 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-11-13 23:19:05 +1100 |
commit | 4f8ba5ad6ac9b7153b0e13654e59f47e67b3f608 (patch) | |
tree | ca189d440b0a298cdcb3769d994828508dcd2e76 /source4/heimdal/lib/asn1/gen_decode.c | |
parent | 5bc87c14a1f5b45ed86e7ff9663f5f0aa2f70094 (diff) | |
download | samba-4f8ba5ad6ac9b7153b0e13654e59f47e67b3f608.tar.gz samba-4f8ba5ad6ac9b7153b0e13654e59f47e67b3f608.tar.bz2 samba-4f8ba5ad6ac9b7153b0e13654e59f47e67b3f608.zip |
s4:heimdal: import lorikeet-heimdal-200911122202 (commit 9291fd2d101f3eecec550178634faa94ead3e9a1)
Diffstat (limited to 'source4/heimdal/lib/asn1/gen_decode.c')
-rw-r--r-- | source4/heimdal/lib/asn1/gen_decode.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source4/heimdal/lib/asn1/gen_decode.c b/source4/heimdal/lib/asn1/gen_decode.c index cf7f0b05dc..327de4c98c 100644 --- a/source4/heimdal/lib/asn1/gen_decode.c +++ b/source4/heimdal/lib/asn1/gen_decode.c @@ -67,6 +67,7 @@ is_primitive_type(int type) case TEnumerated: case TGeneralizedTime: case TGeneralString: + case TTeletexString: case TOID: case TUTCTime: case TUTF8String: @@ -109,6 +110,11 @@ find_tag (const Type *t, *ty = PRIM; *tag = UT_GeneralString; break; + case TTeletexString: + *cl = ASN1_C_UNIV; + *ty = PRIM; + *tag = UT_TeletexString; + break; case TGeneralizedTime: *cl = ASN1_C_UNIV; *ty = PRIM; @@ -489,6 +495,9 @@ decode_type (const char *name, const Type *t, int optional, case TGeneralString: decode_primitive ("general_string", name, forwstr); break; + case TTeletexString: + decode_primitive ("general_string", name, forwstr); + break; case TTag:{ char *tname, *typestring; char *ide = NULL; @@ -621,7 +630,7 @@ decode_type (const char *name, const Type *t, int optional, fprintf(codefile, "else {\n" "(%s)->u.%s.data = calloc(1, len);\n" - "if ((%s)->u.%s.data == NULL) {\n" + "if ((%s)->u.%s.data == NULL && len != 0) {\n" "e = ENOMEM; %s;\n" "}\n" "(%s)->u.%s.length = len;\n" @@ -703,6 +712,7 @@ generate_type_decode (const Symbol *s) case TOID: case TGeneralizedTime: case TGeneralString: + case TTeletexString: case TUTF8String: case TPrintableString: case TIA5String: @@ -734,7 +744,7 @@ generate_type_decode (const Symbol *s) if (preserve) fprintf (codefile, "data->_save.data = calloc(1, ret);\n" - "if (data->_save.data == NULL) { \n" + "if (data->_save.data == NULL && ret != 0) { \n" "e = ENOMEM; goto fail; \n" "}\n" "data->_save.length = ret;\n" |