1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-11 03:55:03 -05:00

cyassl: Check for invalid length parameter in Curl_cyassl_random

This commit is contained in:
Jay Satiro 2015-03-25 02:37:20 -04:00 committed by Daniel Stenberg
parent ec31962640
commit d29f8b460c

View File

@ -640,7 +640,9 @@ int Curl_cyassl_random(struct SessionHandle *data,
(void)data; (void)data;
if(InitRng(&rng)) if(InitRng(&rng))
return 1; return 1;
if(RNG_GenerateBlock(&rng, entropy, length)) if(length > UINT_MAX)
return 1;
if(RNG_GenerateBlock(&rng, entropy, (unsigned)length))
return 1; return 1;
return 0; return 0;
} }