-
Couldn't load subscription status.
- Fork 8k
Improve error reporting in random extension #9071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
8daa5fe
b7bdf1a
f93daeb
fdfa2f3
12b07ce
3e18441
8adb67a
3090379
39b996a
734c79c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,9 @@ | |
| #include "php.h" | ||
| #include "php_random.h" | ||
|
|
||
| #include "ext/spl/spl_exceptions.h" | ||
| #include "Zend/zend_exceptions.h" | ||
|
|
||
| static uint64_t generate(php_random_status *status) | ||
| { | ||
| php_random_status_state_user *s = status->state; | ||
|
|
@@ -50,6 +53,7 @@ static uint64_t generate(php_random_status *status) | |
| result += ((uint64_t) (unsigned char) Z_STRVAL(retval)[i]) << (8 * i); | ||
| } | ||
| } else { | ||
| zend_throw_exception(spl_ce_DomainException, "A random engine must return a non-empty string", 0); | ||
|
||
| status->last_unsafe = true; | ||
| return 0; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.