From 6215f27a83c6b9089a217dd6deab1665e0ced516 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Sun, 2 Oct 2016 14:13:40 +0100 Subject: Fix embedded string handling. Don't rely on embedded flag to free strings correctly: it wont be set if there is a malloc failure during initialisation. Thanks to Guido Vranken for reporting this issue. Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/1725) --- crypto/asn1/asn1_locl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crypto/asn1/asn1_locl.h') diff --git a/crypto/asn1/asn1_locl.h b/crypto/asn1/asn1_locl.h index 56c9954..5f597bd 100644 --- a/crypto/asn1/asn1_locl.h +++ b/crypto/asn1/asn1_locl.h @@ -45,6 +45,8 @@ DEFINE_STACK_OF(MIME_HEADER) /* Month values for printing out times */ extern const char *_asn1_mon[12]; +void asn1_string_embed_free(ASN1_STRING *a, int embed); + int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it); int asn1_set_choice_selector(ASN1_VALUE **pval, int value, const ASN1_ITEM *it); @@ -63,7 +65,7 @@ int asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval, int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen, const ASN1_ITEM *it); -void asn1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it); +void asn1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed); void asn1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, -- cgit v1.1