Skip to content

Commit

Permalink
For n > 7, we might get uninitialized (unzeroed) data.
Browse files Browse the repository at this point in the history
Spotted by "Kyoungho Jeon" <k.h.jeon@securesoft.co.kr>.
  • Loading branch information
levitte committed Aug 6, 2000
1 parent 2d978cb commit 5584fa1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crypto/asn1/a_bitstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
else
c=(unsigned char *)OPENSSL_realloc(a->data,w+1);
if (c == NULL) return(0);
if (w+1-a->length > 0) memset(c+a->length, 0, w+1-a->length);
a->data=c;
a->length=w+1;
c[w]=0;
}
}
a->data[w]=((a->data[w])&iv)|v;
while ((a->length > 0) && (a->data[a->length-1] == 0))
a->length--;
Expand Down

0 comments on commit 5584fa1

Please sign in to comment.