summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/a_bitstr.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2002-02-03 21:31:41 +0000
committerRichard Levitte <levitte@openssl.org>2002-02-03 21:31:41 +0000
commitb9a3ef4c6e96f74b995474d84add495072ad8951 (patch)
tree55156961e924932719931ffe2c7faa6d16327403 /crypto/asn1/a_bitstr.c
parent1955b8742354a989650853412c27863f1644e81d (diff)
ASN1_BIT_STRING_set_bit() didn't clear previously set bits
Diffstat (limited to 'crypto/asn1/a_bitstr.c')
-rw-r--r--crypto/asn1/a_bitstr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c
index 46e97038a2..c36817c1ee 100644
--- a/crypto/asn1/a_bitstr.c
+++ b/crypto/asn1/a_bitstr.c
@@ -172,6 +172,7 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
w=n/8;
v=1<<(7-(n&0x07));
iv= ~v;
+ if (!value) v=0;
a->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear, set on write */