diff options
Diffstat (limited to 'CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c')
-rw-r--r-- | CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c b/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c index 881141cd08..dcc1853f13 100644 --- a/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c +++ b/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c @@ -41,6 +41,10 @@ RandomSeed ( {
CHAR8 DefaultSeed[128];
+ 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.
@@ -86,7 +90,7 @@ RandomBytes ( //
// Check input parameters.
//
- if (Output == NULL) {
+ if (Output == NULL || Size > INT_MAX) {
return FALSE;
}
|