diff options
author | Nils Larsch <nils@openssl.org> | 2005-07-26 21:10:34 +0000 |
---|---|---|
committer | Nils Larsch <nils@openssl.org> | 2005-07-26 21:10:34 +0000 |
commit | c755c5fd8ba5771691451e9d1b163544fdadb7ec (patch) | |
tree | e9ba80b2ad6965f3803a0d2273b8797258023586 /crypto/asn1/a_bitstr.c | |
parent | 5c8e9139d18ca20fd4a6f194697d2e2634009cca (diff) |
improved error checking and some fixes
PR: 1170
Submitted by: Yair Elharrar
Reviewed and edited by: Nils Larsch
Diffstat (limited to 'crypto/asn1/a_bitstr.c')
-rw-r--r-- | crypto/asn1/a_bitstr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c index f621426d6f..0fb9ce0c2a 100644 --- a/crypto/asn1/a_bitstr.c +++ b/crypto/asn1/a_bitstr.c @@ -183,9 +183,11 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) iv= ~v; if (!value) v=0; + if (a == NULL) + return 0; + 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 */ |