Re: cvs: php-src /ext/mysqli mysqli_api.c
| From: | Andrey Hristov | Date: | Fri, 09 Mar 2007 08:38:44 +0000 |
| Subject: | Re: cvs: php-src /ext/mysqli mysqli_api.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-43477@lists.php.net to get a copy of this message | ||
Stas,
test case?
Stanislav Malyshev wrote:
> stas Thu Mar 8 22:57:02 2007 UTC
>
> Modified files:
> /php-src/ext/mysqli mysqli_api.c
> Log:
> MFB: fix crash/leak in bug #38710
>
>
>
> http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.144&r2=1.145&diff_format=u
> Index: php-src/ext/mysqli/mysqli_api.c
> diff -u php-src/ext/mysqli/mysqli_api.c:1.144 php-src/ext/mysqli/mysqli_api.c:1.145
> --- php-src/ext/mysqli/mysqli_api.c:1.144 Sat Feb 24 16:25:54 2007
> +++ php-src/ext/mysqli/mysqli_api.c Thu Mar 8 22:57:02 2007
> @@ -15,7 +15,7 @@
> | Author: Georg Richter <georg@php.net> |
> +----------------------------------------------------------------------+
>
> - $Id: mysqli_api.c,v 1.144 2007/02/24 16:25:54 helly Exp $
> + $Id: mysqli_api.c,v 1.145 2007/03/08 22:57:02 stas Exp $
> */
>
> #ifdef HAVE_CONFIG_H
> @@ -764,7 +764,16 @@
> }
> #endif
> else {
> - ZVAL_UTF8_STRINGL(stmt->result.vars[i], stmt->result.buf[i].val,
> stmt->result.buf[i].buflen, ZSTR_DUPLICATE);
> +#if defined(MYSQL_DATA_TRUNCATED) && MYSQL_VERSION_ID > 50002
> + if(ret == MYSQL_DATA_TRUNCATED && *(stmt->stmt->bind[i].error) != 0) {
> + /* result was truncated */
> + ZVAL_UTF8_STRINGL(stmt->result.vars[i], stmt->result.buf[i].val,
> stmt->stmt->bind[i].buffer_length, ZSTR_DUPLICATE);
> + } else {
> +#else
> + {
> +#endif
> + ZVAL_UTF8_STRINGL(stmt->result.vars[i], stmt->result.buf[i].val,
> stmt->result.buf[i].buflen, ZSTR_DUPLICATE);
> + }
>
> }
> break;
>
Andrey