php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64099 Wrong TSRM usage in zend_register_class_alias
Submitted: 2013-01-29 17:44 UTC Modified: 2013-01-30 06:44 UTC
From: eduosi at 163 dot com Assigned: johannes
Status: Closed Package: *General Issues
PHP Version: master-Git-2013-01-29 (Git) OS:
Private report: No CVE-ID:
 [2013-01-29 17:44 UTC] eduosi at 163 dot com
Description:
------------
问题一、Zend/Zend_API.h 中,宏 zend_register_class_alias、zend_register_ns_class_alias,按理解这两个宏的作用是提供调用的,但是这两个宏展开后,zend_register_class_alias_ex和zend_register_class_alias_ex这两个函数的最后一个参数是 TSRMLS_DC,而非TSRMLS_CC

问题二、ext/mysqlnd/mysqlnd_result.c 中 mysqlnd_res::fetch_into,中初始化 return_value,为 mysqlnd_array_init(return_value, mysqlnd_num_fields(result) * 2),为什么在返回的结果不是 both 还需要用 fields_count * 2?而不直接fields_count?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-29 18:50 UTC] johannes@php.net
-Status: Open +Status: Closed
 [2013-01-29 18:50 UTC] johannes@php.net
Automatic comment on behalf of johannes
Revision: http://git.php.net/?p=php-src.git;a=commit;h=93fd9c704b9aae141008274e9f3bd2775116a83a
Log: Fix bug #64099 (Wrong TSRM usage in zend_register_class_alias)
 [2013-01-29 18:56 UTC] johannes@php.net
-Assigned To: +Assigned To: johannes
 [2013-01-29 18:56 UTC] johannes@php.net
Hi,

I've fixed the first issue.


To the second thing: My Chinese is too limited, so I'm not sure I understand this correctly, but: In mysqlnd_array_init(return_value, mysqlnd_num_fields(result) * 2); we are using the factor 2  as we're building an array where we have two entries for each column - once with the field name as string and second time with the filed name number (ordinal).

Please mind that this is no support forum. If you have question write the generals list, for internals ask either the internals list or pecl dev and try to use English, as we otherwise have trouble to understand.
 [2013-01-30 03:33 UTC] laruence@php.net
I think you understand the question properly :)
 [2013-01-30 06:44 UTC] sixd@php.net
-Summary: bug&&question +Summary: Wrong TSRM usage in zend_register_class_alias
 [2013-03-01 18:32 UTC] stas@php.net
Automatic comment on behalf of johannes
Revision: http://git.php.net/?p=php-src.git;a=commit;h=93fd9c704b9aae141008274e9f3bd2775116a83a
Log: Fix bug #64099 (Wrong TSRM usage in zend_register_class_alias)
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 22:02:16 2014 UTC