l must be > 0 or array will be accessed out of bounds.
This commit is contained in:
Dr. Stephen Henson 2009-03-12 17:09:46 +00:00
parent 6fe9c925d2
commit 7a0c01b41a

View File

@ -2428,7 +2428,7 @@ static void readbn(BIGNUM **bn, BIO *bconn)
int l; int l;
l = BIO_gets(bconn, buf, sizeof buf); l = BIO_gets(bconn, buf, sizeof buf);
assert(l >= 0); assert(l > 0);
assert(buf[l-1] == '\n'); assert(buf[l-1] == '\n');
buf[l-1] = '\0'; buf[l-1] = '\0';
BN_hex2bn(bn, buf); BN_hex2bn(bn, buf);