Welcome! Log In Create A New Profile

Advanced

[PHP-DEV] [PATCH]: Fix for endless loop in PDOStatement::debugDumpParams()

Posted by Jonah H. Harris 
While using PDOStatement::debugDumpParams, I noticed that it results
in an endless loop because the hash table is not being traversed. As
such, attached is a patch against php5 HEAD which adds
zend_hash_move_forward_ex accordingly.

--
Jonah H. Harris, Senior DBA
myYearbook.com


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Jonah H. Harris wrote:
> While using PDOStatement::debugDumpParams, I noticed that it results
> in an endless loop because the hash table is not being traversed. As
> such, attached is a patch against php5 HEAD which adds
> zend_hash_move_forward_ex accordingly.
>
>

Your patch was stripped, can you attach against with a .txt extension.

Scott

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
On 03.11.2008, at 19:54, Scott MacVicar wrote:

> Jonah H. Harris wrote:
>> While using PDOStatement::debugDumpParams, I noticed that it results
>> in an endless loop because the hash table is not being traversed. As
>> such, attached is a patch against php5 HEAD which adds
>> zend_hash_move_forward_ex accordingly.
>>
>>
>
> Your patch was stripped, can you attach against with a .txt extension.


interesting .. i wasnt aware of this method. there is a doc bug on
this on pecl.php.net:
http://pecl.php.net/bugs/bug.php?id=13035

once again a reminder that we really do not have a good setup yet to
manage the movement of extensions between pecl and php-src. also a
pitty that the GSoC for a unified bug tracker apparently did not get
finished (?)

regards,
Lukas Kahwe Smith
mls@pooteeweet.org




--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
On Mon, Nov 3, 2008 at 1:54 PM, Scott MacVicar <[email protected]> wrote:
> Your patch was stripped, can you attach against with a .txt extension.

Attached.

--
Jonah H. Harris, Senior DBA
myYearbook.com

diff -cr php5/ext/pdo/pdo_stmt.c php5-pdofix/ext/pdo/pdo_stmt.c
*** php5/ext/pdo/pdo_stmt.c Mon Nov 3 10:33:22 2008
--- php5-pdofix/ext/pdo/pdo_stmt.c Mon Nov 3 13:09:02 2008
***************
*** 2208,2213 ****
--- 2208,2214 ----
param->is_param,
param->param_type);

+ zend_hash_move_forward_ex(stmt->bound_params, &pos);
}
}

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Attachments:
open | download - pdo_dbgparam_loopfix_v1.txt (358 bytes)
open | download - pdo_dbgparam_loopfix_v1.txt (358 bytes)
Hi Jonah,

Em Seg, 2008-11-03 às 14:44 -0500, Jonah H. Harris escreveu:
> On Mon, Nov 3, 2008 at 1:54 PM, Scott MacVicar <[email protected]> wrote:
> > Your patch was stripped, can you attach against with a .txt extension.
>
> Attached.
>

Thanks for the patch!

Fixed in CVS. (5.2.7+)

--
Regards,
Felipe Pena


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Sorry, only registered users may post in this forum.

Click here to login