Re: svn: /php/php-src/trunk/ext/mysqlnd/ mysqlnd_auth.c
| From: | Andrey Hristov | Date: | Mon, 31 Jan 2011 14:55:52 +0000 |
| Subject: | Re: svn: /php/php-src/trunk/ext/mysqlnd/ mysqlnd_auth.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-64470@lists.php.net to get a copy of this message | ||
On 01/31/2011 01:32 PM, Kalle Sommer Nielsen wrote:
> kalle Mon, 31 Jan 2011 12:32:32 +0000
>
> Revision:
> http://svn.php.net/viewvc?view=revision&revision=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