diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/tasn_utl.c')
| -rw-r--r-- | src/lib/libcrypto/asn1/tasn_utl.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/lib/libcrypto/asn1/tasn_utl.c b/src/lib/libcrypto/asn1/tasn_utl.c index 37c86c6af8..9715dac931 100644 --- a/src/lib/libcrypto/asn1/tasn_utl.c +++ b/src/lib/libcrypto/asn1/tasn_utl.c | |||
| @@ -109,8 +109,7 @@ int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it) | |||
| 109 | if (!aux || !(aux->flags & ASN1_AFLG_REFCOUNT)) | 109 | if (!aux || !(aux->flags & ASN1_AFLG_REFCOUNT)) |
| 110 | return 0; | 110 | return 0; |
| 111 | lck = offset2ptr(*pval, aux->ref_offset); | 111 | lck = offset2ptr(*pval, aux->ref_offset); |
| 112 | if (op == 0) | 112 | if (op == 0) { |
| 113 | { | ||
| 114 | *lck = 1; | 113 | *lck = 1; |
| 115 | return 1; | 114 | return 1; |
| 116 | } | 115 | } |
| @@ -133,8 +132,7 @@ void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it) | |||
| 133 | { | 132 | { |
| 134 | ASN1_ENCODING *enc; | 133 | ASN1_ENCODING *enc; |
| 135 | enc = asn1_get_enc_ptr(pval, it); | 134 | enc = asn1_get_enc_ptr(pval, it); |
| 136 | if (enc) | 135 | if (enc) { |
| 137 | { | ||
| 138 | enc->enc = NULL; | 136 | enc->enc = NULL; |
| 139 | enc->len = 0; | 137 | enc->len = 0; |
| 140 | enc->modified = 1; | 138 | enc->modified = 1; |
| @@ -145,8 +143,7 @@ void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it) | |||
| 145 | { | 143 | { |
| 146 | ASN1_ENCODING *enc; | 144 | ASN1_ENCODING *enc; |
| 147 | enc = asn1_get_enc_ptr(pval, it); | 145 | enc = asn1_get_enc_ptr(pval, it); |
| 148 | if (enc) | 146 | if (enc) { |
| 149 | { | ||
| 150 | if (enc->enc) | 147 | if (enc->enc) |
| 151 | free(enc->enc); | 148 | free(enc->enc); |
| 152 | enc->enc = NULL; | 149 | enc->enc = NULL; |
| @@ -182,8 +179,7 @@ int asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval, | |||
| 182 | enc = asn1_get_enc_ptr(pval, it); | 179 | enc = asn1_get_enc_ptr(pval, it); |
| 183 | if (!enc || enc->modified) | 180 | if (!enc || enc->modified) |
| 184 | return 0; | 181 | return 0; |
| 185 | if (out) | 182 | if (out) { |
| 186 | { | ||
| 187 | memcpy(*out, enc->enc, enc->len); | 183 | memcpy(*out, enc->enc, enc->len); |
| 188 | *out += enc->len; | 184 | *out += enc->len; |
| 189 | } | 185 | } |
| @@ -228,8 +224,7 @@ const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt, | |||
| 228 | sfld = offset2ptr(*pval, adb->offset); | 224 | sfld = offset2ptr(*pval, adb->offset); |
| 229 | 225 | ||
| 230 | /* Check if NULL */ | 226 | /* Check if NULL */ |
| 231 | if (!sfld) | 227 | if (!sfld) { |
| 232 | { | ||
| 233 | if (!adb->null_tt) | 228 | if (!adb->null_tt) |
| 234 | goto err; | 229 | goto err; |
| 235 | return adb->null_tt; | 230 | return adb->null_tt; |
