stas Thu Mar 8 22:49:53 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/mysqli mysqli_api.c Log: fix crash/leak in bug #38710 http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.118.2.22.2.10&r2=1.118.2.22.2.11&diff_format=u Index: php-src/ext/mysqli/mysqli_api.c diff -u php-src/ext/mysqli/mysqli_api.c:1.118.2.22.2.10 php-src/ext/mysqli/mysqli_api.c:1.118.2.22.2.11 --- php-src/ext/mysqli/mysqli_api.c:1.118.2.22.2.10 Sat Feb 24 02:17:25 2007 +++ php-src/ext/mysqli/mysqli_api.c Thu Mar 8 22:49:53 2007 @@ -15,7 +15,7 @@ | Author: Georg Richter <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ - $Id: mysqli_api.c,v 1.118.2.22.2.10 2007/02/24 02:17:25 helly Exp $ + $Id: mysqli_api.c,v 1.118.2.22.2.11 2007/03/08 22:49:53 stas Exp $ */ #ifdef HAVE_CONFIG_H @@ -723,7 +723,16 @@ } #endif else { - ZVAL_STRINGL(stmt->result.vars[i], stmt->result.buf[i].val, stmt->result.buf[i].buflen, 1); +#if defined(MYSQL_DATA_TRUNCATED) && MYSQL_VERSION_ID > 50002 + if(ret == MYSQL_DATA_TRUNCATED && *(stmt->stmt->bind[i].error) != 0) { + /* result was truncated */ + ZVAL_STRINGL(stmt->result.vars[i], stmt->result.buf[i].val, stmt->stmt->bind[i].buffer_length, 1); + } else { +#else + { +#endif + ZVAL_STRINGL(stmt->result.vars[i], stmt->result.buf[i].val, stmt->result.buf[i].buflen, 1); + } } break; default:
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php