PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTTP » HTTP_Server » Bug #2531

Server shutdown on bad Request

Details

Submitted2004-10-14 16:53 UTC
Frommaka3d at yahoo dot com dot br
Assignedschst
StatusClosed
PackageHTTP_Server
PHP Version4.3.9
OSany
Roadmaps(Not assigned)

Comments

[2004-10-14 16:53 UTC] maka3d at yahoo dot com dot br

Description:
------------
Fatal error: Call to a member function on a non-object in PEAR\HTTP\Server.php on line 219
The problem is that $request is false when a bad request is received.
The line 203 to 205 could be changed from:
$request = &HTTP_Server_Request::parse($data);

$this->_serveRequest($clientId, $request);
to:
$request = &HTTP_Server_Request::parse($data);
if($request === false) {
$this->onBadRequest($clientId, $data);
}
$this->_serveRequest($clientId, $request);

Reproduce code:
---------------
Just star the server and send a bad Request like: HTTPFOO/1.0

Expected result:
----------------
Server should handle the bad request

Actual result:
--------------
A fatal error and server shutdown

[2004-11-16 11:24 UTC] cox at idecnet dot com

I've verified this error and involves a security problem of the class.