projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
improved error checking and some fixes
[openssl.git]
/
crypto
/
asn1
/
a_bitstr.c
diff --git
a/crypto/asn1/a_bitstr.c
b/crypto/asn1/a_bitstr.c
index 6e92ff5a8420e4c2bf9a996f8dd017faff9ea0a2..0fb9ce0c2aea189ce384b988361b868d758f9efa 100644
(file)
--- a/
crypto/asn1/a_bitstr.c
+++ b/
crypto/asn1/a_bitstr.c
@@
-165,7
+165,7
@@
ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
*pp=p;
return(ret);
err:
*pp=p;
return(ret);
err:
- ASN1err(ASN1_F_
D
2I_ASN1_BIT_STRING,i);
+ ASN1err(ASN1_F_
C
2I_ASN1_BIT_STRING,i);
if ((ret != NULL) && ((a == NULL) || (*a != ret)))
M_ASN1_BIT_STRING_free(ret);
return(NULL);
if ((ret != NULL) && ((a == NULL) || (*a != ret)))
M_ASN1_BIT_STRING_free(ret);
return(NULL);
@@
-183,9
+183,11
@@
int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
iv= ~v;
if (!value) v=0;
iv= ~v;
if (!value) v=0;
+ if (a == NULL)
+ return 0;
+
a->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear, set on write */
a->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear, set on write */
- if (a == NULL) return(0);
if ((a->length < (w+1)) || (a->data == NULL))
{
if (!value) return(1); /* Don't need to set */
if ((a->length < (w+1)) || (a->data == NULL))
{
if (!value) return(1); /* Don't need to set */