(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:
Love Hörnquist Åstrand
2006-02-16 10:08:34 +00:00
parent e4531fd61d
commit a2cdaa4cb6

View File

@@ -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;