Re: [PHP-CVS] svn: /php/php-src/trunk/ext/mysqlnd/ mysqlnd_auth.c
On Mon, Jan 31, 2011 at 3:55 PM, Andrey Hristov p...@hristov.com wrote: this will return emalloc-ed memory, right? Later this memory will be freed with free() and guess what happens :) Is it used outside php? if not then it is a documentation matter no? returned value has to be freed using efree. Cheers, -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/trunk/ext/mysqlnd/ mysqlnd_auth.c
Hi Andrey 2011/1/31, Andrey Hristov p...@hristov.com: On 01/31/2011 01:32 PM, Kalle Sommer Nielsen wrote: this will return emalloc-ed memory, right? Later this memory will be freed with free() and guess what happens :) No, the e functions will return emalloc()'d memory, the zend_str functions will return malloc()'d memory, see its implementation: http://lxr.php.net/opengrok/xref/PHP_TRUNK/Zend/zend_alloc.c#2566 -- regards, Kalle Sommer Nielsen ka...@php.net -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/trunk/ext/mysqlnd/ mysqlnd_auth.c
On 02/01/2011 11:36 AM, Kalle Sommer Nielsen wrote: Hi Andrey 2011/1/31, Andrey Hristov p...@hristov.com: On 01/31/2011 01:32 PM, Kalle Sommer Nielsen wrote: this will return emalloc-ed memory, right? Later this memory will be freed with free() and guess what happens :) No, the e functions will return emalloc()'d memory, the zend_str functions will return malloc()'d memory, see its implementation: http://lxr.php.net/opengrok/xref/PHP_TRUNK/Zend/zend_alloc.c#2566 Right, sorry :(, I saw the implementation later Best, Andrey -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mysqlnd/ mysqlnd_auth.c
kalleMon, 31 Jan 2011 12:32:32 + Revision: http://svn.php.net/viewvc?view=revisionrevision=307878 Log: Use our own zend_strndup() implementation of strndup() -- Fixes build on platforms without strndup(), like Windows Changed paths: U php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c2011-01-31 11:41:33 UTC (rev 307877) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c2011-01-31 12:32:32 UTC (rev 307878) @@ -428,7 +428,7 @@ /* copy pass*/ if (passwd passwd_len) { - ret = (zend_uchar*) strndup(passwd, passwd_len); + ret = (zend_uchar*) zend_strndup(passwd, passwd_len); } *auth_data_len = passwd_len; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/trunk/ext/mysqlnd/ mysqlnd_auth.c
On 01/31/2011 01:32 PM, Kalle Sommer Nielsen wrote: kalleMon, 31 Jan 2011 12:32:32 + Revision: http://svn.php.net/viewvc?view=revisionrevision=307878 Log: Use our own zend_strndup() implementation of strndup() -- Fixes build on platforms without strndup(), like Windows Changed paths: U php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c 2011-01-31 11:41:33 UTC (rev 307877) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c 2011-01-31 12:32:32 UTC (rev 307878) @@ -428,7 +428,7 @@ /* copy pass*/ if (passwd passwd_len) { - ret = (zend_uchar*) strndup(passwd, passwd_len); + ret = (zend_uchar*) zend_strndup(passwd, passwd_len); } *auth_data_len = passwd_len; this will return emalloc-ed memory, right? Later this memory will be freed with free() and guess what happens :) Andrey -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mysqlnd/ mysqlnd_auth.c
andrey Thu, 27 Jan 2011 17:30:29 + Revision: http://svn.php.net/viewvc?view=revisionrevision=307798 Log: fix a crash in new code Changed paths: U php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c2011-01-27 16:02:30 UTC (rev 307797) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c2011-01-27 17:30:29 UTC (rev 307798) @@ -141,7 +141,9 @@ } SET_NEW_MESSAGE(conn-last_message, conn-last_message_len, auth_resp_packet-message, auth_resp_packet-message_len, conn-persistent); - conn-charset = mysqlnd_find_charset_nr(auth_packet-charset_no); + if (use_full_blown_auth_packet == TRUE) { + conn-charset = mysqlnd_find_charset_nr(auth_packet-charset_no); + } ret = PASS; end: PACKET_FREE(change_auth_resp_packet); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mysqlnd/ mysqlnd_auth.c
andrey Thu, 27 Jan 2011 18:51:12 + Revision: http://svn.php.net/viewvc?view=revisionrevision=307799 Log: a better habitat Changed paths: U php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c2011-01-27 17:30:29 UTC (rev 307798) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c2011-01-27 18:51:12 UTC (rev 307799) @@ -110,6 +110,9 @@ goto end; } } + if (use_full_blown_auth_packet == TRUE) { + conn-charset = mysqlnd_find_charset_nr(auth_packet-charset_no); + } if (FAIL == PACKET_READ(auth_resp_packet, conn) || auth_resp_packet-response_code = 0xFE) { if (auth_resp_packet-response_code == 0xFE) { @@ -141,9 +144,6 @@ } SET_NEW_MESSAGE(conn-last_message, conn-last_message_len, auth_resp_packet-message, auth_resp_packet-message_len, conn-persistent); - if (use_full_blown_auth_packet == TRUE) { - conn-charset = mysqlnd_find_charset_nr(auth_packet-charset_no); - } ret = PASS; end: PACKET_FREE(change_auth_resp_packet); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mysqlnd/ mysqlnd_auth.c
andrey Mon, 24 Jan 2011 13:59:28 + Revision: http://svn.php.net/viewvc?view=revisionrevision=307712 Log: fix typos Changed paths: U php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c2011-01-24 13:58:18 UTC (rev 307711) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_auth.c2011-01-24 13:59:28 UTC (rev 307712) @@ -439,10 +439,10 @@ { { MYSQLND_PLUGIN_API_VERSION, - auth_plugin_authentication_pam, + auth_plugin_mysql_clear_password, MYSQLND_VERSION_ID, MYSQLND_VERSION, - Proprietatry, + PHP License 3.01, Andrey Hristov and...@mysql.com, Ulf Wendel uwen...@mysql.com, Georg Richter ge...@mysql.com, { NULL, /* no statistics , will be filled later if there are some */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php