From: Antony Dovgal Date: Sun, 27 Nov 2005 21:01:02 +0000 (+0000) Subject: MFH: fix #35430 (PDO crashes on incorrect FETCH_FUNC use) X-Git-Tag: php-5.1.2RC1~346 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6543134deaa61a3d779c96728342046084e8986c;p=php MFH: fix #35430 (PDO crashes on incorrect FETCH_FUNC use) --- diff --git a/NEWS b/NEWS index 0823cf35c1..35c1922129 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +?? ??? 200?, PHP 5.1.2 +- Fixed bug #35430 (PDO crashes on incorrect FETCH_FUNC use). (Tony) + 28 Nov 2005, PHP 5.1.1 - Disabled native date class to prevent pear::date conflict. (Ilia) - Changed reflection constants be both PHP and class constants. (Johannes) diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 62caef2e5f..c29036f50b 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1353,13 +1353,15 @@ static PHP_METHOD(PDOStatement, fetchAll) switch(ZEND_NUM_ARGS()) { case 0: case 1: + pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "no fetch function specified" TSRMLS_CC); + error = 1; break; case 3: case 2: stmt->fetch.func.function = arg2; + do_fetch_func_prepare(stmt TSRMLS_CC); break; } - do_fetch_func_prepare(stmt TSRMLS_CC); break; case PDO_FETCH_COLUMN: