diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/a_bitstr.c')
-rw-r--r-- | src/lib/libcrypto/asn1/a_bitstr.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/lib/libcrypto/asn1/a_bitstr.c b/src/lib/libcrypto/asn1/a_bitstr.c index 0fb9ce0c2a..b81bf4fc81 100644 --- a/src/lib/libcrypto/asn1/a_bitstr.c +++ b/src/lib/libcrypto/asn1/a_bitstr.c | |||
@@ -113,12 +113,11 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) | |||
113 | return(ret); | 113 | return(ret); |
114 | } | 114 | } |
115 | 115 | ||
116 | ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, | 116 | ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp, |
117 | const unsigned char **pp, long len) | 117 | long len) |
118 | { | 118 | { |
119 | ASN1_BIT_STRING *ret=NULL; | 119 | ASN1_BIT_STRING *ret=NULL; |
120 | const unsigned char *p; | 120 | unsigned char *p,*s; |
121 | unsigned char *s; | ||
122 | int i; | 121 | int i; |
123 | 122 | ||
124 | if (len < 1) | 123 | if (len < 1) |
@@ -165,7 +164,7 @@ ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, | |||
165 | *pp=p; | 164 | *pp=p; |
166 | return(ret); | 165 | return(ret); |
167 | err: | 166 | err: |
168 | ASN1err(ASN1_F_C2I_ASN1_BIT_STRING,i); | 167 | ASN1err(ASN1_F_D2I_ASN1_BIT_STRING,i); |
169 | if ((ret != NULL) && ((a == NULL) || (*a != ret))) | 168 | if ((ret != NULL) && ((a == NULL) || (*a != ret))) |
170 | M_ASN1_BIT_STRING_free(ret); | 169 | M_ASN1_BIT_STRING_free(ret); |
171 | return(NULL); | 170 | return(NULL); |
@@ -183,11 +182,9 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) | |||
183 | iv= ~v; | 182 | iv= ~v; |
184 | if (!value) v=0; | 183 | if (!value) v=0; |
185 | 184 | ||
186 | if (a == NULL) | ||
187 | return 0; | ||
188 | |||
189 | a->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear, set on write */ | 185 | a->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear, set on write */ |
190 | 186 | ||
187 | if (a == NULL) return(0); | ||
191 | if ((a->length < (w+1)) || (a->data == NULL)) | 188 | if ((a->length < (w+1)) || (a->data == NULL)) |
192 | { | 189 | { |
193 | if (!value) return(1); /* Don't need to set */ | 190 | if (!value) return(1); /* Don't need to set */ |