From 9107ff9046dc09e8afdb89e86ce588edb3f4a642 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Thu, 3 Oct 2013 13:19:32 -0400 Subject: Update to current Tiano Cryptlib --- Cryptlib/Rand/CryptRand.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Cryptlib/Rand/CryptRand.c') diff --git a/Cryptlib/Rand/CryptRand.c b/Cryptlib/Rand/CryptRand.c index a61c0c2a..dc3ab992 100644 --- a/Cryptlib/Rand/CryptRand.c +++ b/Cryptlib/Rand/CryptRand.c @@ -43,6 +43,10 @@ RandomSeed ( IN UINTN SeedSize ) { + if (SeedSize > INT_MAX) { + return FALSE; + } + // // Seed the pseudorandom number generator with user-supplied value. // NOTE: A cryptographic PRNG must be seeded with unpredictable data. @@ -82,7 +86,7 @@ RandomBytes ( // // Check input parameters. // - if (Output == NULL) { + if (Output == NULL || Size > INT_MAX) { return FALSE; } -- cgit v1.2.3