From: Scott MacVicar Date: Wed, 7 Dec 2011 20:50:33 +0000 (+0000) Subject: Make sure that we set the strong crypto result to false as well as returning false. X-Git-Tag: php-5.5.0alpha1~741 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b69cfde57060e5717d9b4072147c5470041014b9;p=php Make sure that we set the strong crypto result to false as well as returning false. --- diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index a6ec656540..075dafefe4 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -4939,11 +4939,17 @@ PHP_FUNCTION(openssl_random_pseudo_bytes) /* random/urandom equivalent on Windows */ if (php_win32_get_random_bytes(buffer, (size_t) buffer_length) == FAILURE){ efree(buffer); + if (zstrong_result_returned) { + ZVAL_BOOL(zstrong_result_returned, 0); + } RETURN_FALSE; } #else if ((strong_result = RAND_pseudo_bytes(buffer, buffer_length)) < 0) { efree(buffer); + if (zstrong_result_returned) { + ZVAL_BOOL(zstrong_result_returned, 0); + } RETURN_FALSE; } #endif