summaryrefslogtreecommitdiff
path: root/Cryptlib/Rand/CryptRand.c
diff options
context:
space:
mode:
authorMatthew Garrett <matthew.garrett@nebula.com>2013-10-04 11:51:09 -0400
committerPeter Jones <pjones@redhat.com>2013-10-04 11:51:09 -0400
commit36d13930ee66e12d581a259b2f49b65eed41daeb (patch)
tree23dbc103ff77c4b098c05dd5125a9ddc2c327350 /Cryptlib/Rand/CryptRand.c
parent4bf7fb2ef1ed13251efad3928d41e5eaf2f4aaa4 (diff)
downloadefi-boot-shim-36d13930ee66e12d581a259b2f49b65eed41daeb.tar.gz
efi-boot-shim-36d13930ee66e12d581a259b2f49b65eed41daeb.zip
Update to current Tiano Cryptlib
Diffstat (limited to 'Cryptlib/Rand/CryptRand.c')
-rw-r--r--Cryptlib/Rand/CryptRand.c6
1 files changed, 5 insertions, 1 deletions
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;
}