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

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to