X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fasn1%2Fa_bitstr.c;h=0fb9ce0c2aea189ce384b988361b868d758f9efa;hb=feef17fd8828d37b80c6fdbdb2614937a93654e4;hp=f621426d6f572a9d7d967d051bb245b143446cd3;hpb=aa4ce7315f65fdf8940d5bc9e562aa478f0335d3;p=oweals%2Fopenssl.git 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 */