|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-11-06 03:10 UTC] giampaolo at tomassoni dot biz
Description:
------------
I found this problem with respect to PHP 5.3.3 (which is not in the "PHP version" list) on amd64 architecture. On the x86 one, it works.
pecl_http from at least 1.6.6 reproducibly crashes executing the "reproduce code" below.
Reproduce code:
---------------
<?php
$req = new HttpRequest('http://127.0.0.1/index.html');
$req->setHeaders(array('Host' => 'www.example.com'));
$http =& $req->send();
echo($http->getResponseCode());
?>
Expected result:
----------------
302 or 404, depending on your web server config
Actual result:
--------------
Segmentation fault
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 17 07:00:01 2025 UTC |
Please note the problem seems related bug#15499 . In fact, I solved it by applying a similar patch: --- pecl_http-1.7.0/http_request_object.c 2010-11-05 20:59:26.000000000 +0100 +++ pecl_http-1.7.0-patched/http_request_object.c 2010-11-05 20:58:03.000000000 +0100 @@ -786,7 +786,7 @@ static int apply_pretty_key(void *pDest, int num_args, va_list args, zend_hash_key *hash_key) { - if (hash_key->arKey && hash_key->nKeyLength > 1) { + if (hash_key->h == NULL && hash_key->arKey && hash_key->nKeyLength > 1) { hash_key->h = zend_hash_func(pretty_key(hash_key->arKey, hash_key->nKeyLength - 1, 1, 0), hash_key->nKeyLength); } return ZEND_HASH_APPLY_KEEP;