Fixed bug #42378 (mysqli_stmt_bind_result memory exhaustion)

Fixed regression of bug 38710. Already fixed in HEAD.
#HEAD will be fixed when doing the next merge from svn
This commit is contained in:
Andrey Hristov 2007-09-05 12:36:44 +00:00
parent e56466edc8
commit 649152ca49
3 changed files with 11 additions and 3 deletions

1
NEWS
View file

@ -24,6 +24,7 @@ PHP NEWS
compression stream). (Ilia)
- Fixed bug #42488 (SoapServer reports an encoding error and the error itself
breaks). (Dmitry)
- Fixed bug #42378 (mysqli_stmt_bind_result memory exhaustion). (Andrey)
- Fixed bug #42359 (xsd:list type not parsed). (Dmitry)
- Fixed bug #42326 (SoapServer crash). (Dmitry)
- Fixed bug #42214 (SoapServer sends clients internal PHP errors). (Dmitry)

View file

@ -325,6 +325,9 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
case MYSQL_TYPE_VAR_STRING:
case MYSQL_TYPE_STRING:
case MYSQL_TYPE_BLOB:
case MYSQL_TYPE_TINY_BLOB:
case MYSQL_TYPE_MEDIUM_BLOB:
case MYSQL_TYPE_LONG_BLOB:
case MYSQL_TYPE_TIMESTAMP:
case MYSQL_TYPE_DECIMAL:
#ifdef FIELD_TYPE_NEWDECIMAL
@ -2000,7 +2003,10 @@ PHP_FUNCTION(mysqli_stmt_store_result)
double - but this is a known problem of the simple MySQL API ;)
*/
for (i = mysql_stmt_field_count(stmt->stmt) - 1; i >=0; --i) {
if (stmt->stmt->fields && stmt->stmt->fields[i].type == MYSQL_TYPE_BLOB) {
if (stmt->stmt->fields && (stmt->stmt->fields[i].type == MYSQL_TYPE_BLOB ||
stmt->stmt->fields[i].type == MYSQL_TYPE_MEDIUM_BLOB ||
stmt->stmt->fields[i].type == MYSQL_TYPE_LONG_BLOB))
{
my_bool tmp=1;
mysql_stmt_attr_set(stmt->stmt, STMT_ATTR_UPDATE_MAX_LENGTH, &tmp);
break;

File diff suppressed because one or more lines are too long