diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/tasn_new.c')
-rw-r--r-- | src/lib/libcrypto/asn1/tasn_new.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libcrypto/asn1/tasn_new.c b/src/lib/libcrypto/asn1/tasn_new.c index dc9ddc413a..56c6a19cfb 100644 --- a/src/lib/libcrypto/asn1/tasn_new.c +++ b/src/lib/libcrypto/asn1/tasn_new.c | |||
@@ -156,10 +156,9 @@ asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) | |||
156 | } | 156 | } |
157 | } | 157 | } |
158 | if (!combine) { | 158 | if (!combine) { |
159 | *pval = malloc(it->size); | 159 | *pval = calloc(1, it->size); |
160 | if (!*pval) | 160 | if (!*pval) |
161 | goto memerr; | 161 | goto memerr; |
162 | memset(*pval, 0, it->size); | ||
163 | } | 162 | } |
164 | asn1_set_choice_selector(pval, -1, it); | 163 | asn1_set_choice_selector(pval, -1, it); |
165 | if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL)) | 164 | if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL)) |
@@ -181,10 +180,9 @@ asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) | |||
181 | } | 180 | } |
182 | } | 181 | } |
183 | if (!combine) { | 182 | if (!combine) { |
184 | *pval = malloc(it->size); | 183 | *pval = calloc(1, it->size); |
185 | if (!*pval) | 184 | if (!*pval) |
186 | goto memerr; | 185 | goto memerr; |
187 | memset(*pval, 0, it->size); | ||
188 | asn1_do_lock(pval, 0, it); | 186 | asn1_do_lock(pval, 0, it); |
189 | asn1_enc_init(pval, it); | 187 | asn1_enc_init(pval, it); |
190 | } | 188 | } |