X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=CryptoPkg%2FLibrary%2FBaseCryptLib%2FRand%2FCryptRandItc.c;h=dcc1853f136fb600d44e5676b89433819cd8734a;hp=881141cd087a4ebfc736d82bd278b7766a8d932e;hb=dda39f3a5850458391aaab330971d46bc9c2b690;hpb=a08dcb2ab16fbb496ff837d5c55c4cb22343aaa5 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; }