[Heimdal-source-changes] [heimdal/heimdal] 3d590d: Reapply incorectly reverted gen_template bugfix
GitHub
noreply at github.com
Ons Nov 9 09:35:20 CET 2016
Branch: refs/heads/master
Home: https://github.com/heimdal/heimdal
Commit: 3d590d651fab3ba1852c921809c2abb78416ab7a
https://github.com/heimdal/heimdal/commit/3d590d651fab3ba1852c921809c2abb78416ab7a
Author: Viktor Dukhovni <viktor at dukhovni.org>
Date: 2016-11-09 (Wed, 09 Nov 2016)
Changed paths:
A check-gen.c
R lib/asn1/check-gen.c
M lib/asn1/gen_template.c
Log Message:
-----------
Reapply incorectly reverted gen_template bugfix
Without this, template memory allocation is incorrect for nested
sequences, which, as luck would have it, breaks tests on NetBSD
(whose malloc seems to give tighter allocations).
This partly undoes:
commit 060474df1626bcc597ef6e786cc58d9b2daac8db
Author: Love Hornquist Astrand <lha at h5l.org>
Date: Mon Jun 3 21:45:51 2013 -0700
quel 64bit warnings, fixup implicit encoding for template,
fix spelling
Restoring changes from:
commit 5e081aa4a623ba16fd66449d7a7722e66c3c98d8
Author: Viktor Dukhovni <viktor at dukhovni.org>
Date: Sun May 27 08:07:28 2012 +0000
Fix ASN.1 template compiler bug and add test cases more
likely to trip on similar (structure size/type) errors
For example, without the bugfix, the sizeof(...) argument in multiple
generated nested structure templates is wrong, as seen in the bad vs.
good diff:
--- test_template_asn1-template.c 2016-11-09 08:23:21.000000000 +0000
+++ test_template_asn1-template.c 2016-11-09 08:23:40.000000000 +0000
@@ -593,3 +593,3 @@
const struct asn1_template asn1_TESTImplicit_tag_ti2_26[] = {
-/* 0 */ { 0, sizeof(struct TESTImplicit), ((void *)1) },
+/* 0 */ { 0, sizeof(struct TESTImplicit_ti2), ((void *)1) },
/* 1 */ { A1_TAG_T(ASN1_C_CONTEXT,CONS,127), offsetof(struct TESTImplicit_ti2, foo), asn1_TESTLargeTag_tag_foo_4 }
@@ -1618,3 +1618,3 @@
const struct asn1_template asn1_TESTSeqOf2_tag_strings_68[] = {
-/* 0 */ { 0, sizeof(struct TESTSeqOf2), ((void *)1) },
+/* 0 */ { 0, sizeof(struct TESTSeqOf2_strings), ((void *)1) },
/* 1 */ { A1_OP_SEQOF, 0, asn1_TESTSeqOfSeq2_val_tag_string_60 }
@@ -1679,3 +1679,3 @@
const struct asn1_template asn1_TESTSeqOf3_tag_strings_71[] = {
-/* 0 */ { 0, sizeof(struct TESTSeqOf3), ((void *)1) },
+/* 0 */ { 0, sizeof(struct TESTSeqOf3_strings), ((void *)1) },
/* 1 */ { A1_OP_SEQOF, 0, asn1_TESTSeqOfSeq2_val_tag_string_60 }
@@ -1760,3 +1760,3 @@
const struct asn1_template asn1_TESTSeqOf4_tag_b1_75[] = {
-/* 0 */ { 0, sizeof(struct TESTSeqOf4), ((void *)1) },
+/* 0 */ { 0, sizeof(struct TESTSeqOf4_b1), ((void *)1) },
/* 1 */ { A1_OP_SEQOF, 0, asn1_TESTSeqOf4_seofTstruct_10 }
@@ -1765,3 +1765,3 @@
const struct asn1_template asn1_TESTSeqOf4_tag_b1_74[] = {
-/* 0 */ { 0, sizeof(struct TESTSeqOf4), ((void *)1) },
+/* 0 */ { 0, sizeof(struct TESTSeqOf4_b1), ((void *)1) },
/* 1 */ { A1_TAG_T(ASN1_C_UNIV,CONS,UT_Sequence), 0, asn1_TESTSeqOf4_tag_b1_75 }
@@ -1801,3 +1801,3 @@
const struct asn1_template asn1_TESTSeqOf4_tag_b2_79[] = {
-/* 0 */ { 0, sizeof(struct TESTSeqOf4), ((void *)1) },
+/* 0 */ { 0, sizeof(struct TESTSeqOf4_b2), ((void *)1) },
/* 1 */ { A1_OP_SEQOF, 0, asn1_TESTSeqOf4_seofTstruct_11 }
@@ -1842,3 +1842,3 @@
const struct asn1_template asn1_TESTSeqOf4_tag_b3_84[] = {
-/* 0 */ { 0, sizeof(struct TESTSeqOf4), ((void *)1) },
+/* 0 */ { 0, sizeof(struct TESTSeqOf4_b3), ((void *)1) },
/* 1 */ { A1_OP_SEQOF, 0, asn1_TESTSeqOf4_seofTstruct_12 }
More information about the Heimdal-source-changes
mailing list