]> granicus.if.org Git - php/commitdiff
Make sure that we set the strong crypto result to false as well as returning false.
authorScott MacVicar <scottmac@php.net>
Wed, 7 Dec 2011 20:50:33 +0000 (20:50 +0000)
committerScott MacVicar <scottmac@php.net>
Wed, 7 Dec 2011 20:50:33 +0000 (20:50 +0000)
ext/openssl/openssl.c

index a6ec656540b84b49a9f834427c6cc415339e1547..075dafefe4c6275fdb74d32520a3a3c63690942c 100644 (file)
@@ -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