Skip to content

Commit

Permalink
MFH: Fixed bug #34809 (FETCH_INTO in PDO crashes without a destinatio…
Browse files Browse the repository at this point in the history
…n object).
  • Loading branch information
Ilia Alshanetsky committed Oct 10, 2005
1 parent df71093 commit a5fe980
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ PHP NEWS
(Andrey)
- Fixed bug #34810 (mysqli::init() and others use wrong $this pointer
without checks). (Tony)
- Fixed bug #34809 (FETCH_INTO in PDO crashes without a destination object).
(Ilia)
- Fixed bug #34802 (Fixed crash on object instantiation failure). (Ilia)
- Fixed bug #34796 (missing SSL linking in ext/ftp when configured as shared).
(Jani)
Expand Down
6 changes: 6 additions & 0 deletions ext/pdo/pdo_stmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,12 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value,
break;

case PDO_FETCH_INTO:
if (!stmt->fetch.into) {
pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch-into object specified." TSRMLS_CC);
return 0;
break;
}

Z_TYPE_P(return_value) = IS_OBJECT;
Z_OBJ_HANDLE_P(return_value) = Z_OBJ_HANDLE_P(stmt->fetch.into);
Z_OBJ_HT_P(return_value) = Z_OBJ_HT_P(stmt->fetch.into);
Expand Down

0 comments on commit a5fe980

Please sign in to comment.