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

http\Env\Request::getForm/getQuery crash #7

bmadzar opened this Issue Jul 21, 2015 · 0 comments


None yet
2 participants

bmadzar commented Jul 21, 2015

There is a reproducible crash (SIGSEGV) that seems to happen due to incorrect handling of the "Array to string conversion" notice when converted to an Exception by a custom error handler.

If a form or query parameter is an array but is cast to string by passing http\QueryString::TYPE_STRING to getForm/getQuery, PHP raises an E_NOTICE level error for the array-to-string conversion.
If there is a custom error handler defined that throws exceptions, this causes a segmentation fault and the entire worker process crashes.

Reproduction script (Debian x86_64, gcc 4.9.3, http 2.5.0, PHP 5.6.11):

set_error_handler(function() {
    throw new Exception();

$request = new http\Env\Request();
var_dump($request->getForm("test", http\QueryString::TYPE_STRING));
<form method="POST">
    <input type="text" name="test[array]">
    <button type="submit">Submit</button>

@m6w6 m6w6 added the in progress label Jul 22, 2015

m6w6 added a commit that referenced this issue Jul 22, 2015

Fix gh-issue #7
Fix crash on returning from a sub-call to querystring from env_request
after an exception.

Closes gh-issue #7

@m6w6 m6w6 closed this Jul 22, 2015

@m6w6 m6w6 added bug and removed in progress labels Jul 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment