(BN_rand): check return value from RAND_bytes
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16747 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -337,7 +337,11 @@ BN_rand(BIGNUM *bn, int bits, int top, int bottom)
|
||||
return 0;
|
||||
i->length = len;
|
||||
|
||||
RAND_bytes(i->data, i->length);
|
||||
if (RAND_bytes(i->data, i->length) != 1) {
|
||||
free(i->data);
|
||||
i->data = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
{
|
||||
size_t i = len * 8;
|
||||
|
Reference in New Issue
Block a user