]> granicus.if.org Git - php/commitdiff
MFH: fix #35430 (PDO crashes on incorrect FETCH_FUNC use)
authorAntony Dovgal <tony2001@php.net>
Sun, 27 Nov 2005 21:01:02 +0000 (21:01 +0000)
committerAntony Dovgal <tony2001@php.net>
Sun, 27 Nov 2005 21:01:02 +0000 (21:01 +0000)
NEWS
ext/pdo/pdo_stmt.c

diff --git a/NEWS b/NEWS
index 0823cf35c1d0ba4087dee64feecb8eb5ca08ca35..35c19221291d145df6af90310716db32b89f7336 100644 (file)
--- 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)
index 62caef2e5fea49560360f2b28d49b33c244e0b49..c29036f50b4e7790f602e3044171f5d1ce3be07a 100755 (executable)
@@ -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: