Skip to content

Commit 4020933

Browse files
author
Ilia Alshanetsky
committed
Fixed bug #35303 (PDO prepare() crashes with invalid parameters).
1 parent db77890 commit 4020933

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

NEWS

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? Nov 2005, PHP 5.1
4+
- Fixed bug #35303 (PDO prepare() crashes with invalid parameters). (Ilia)
45
- Fixed bug #35293 (PDO segfaults when using persistent connections). (Tony)
56
- Fixed bug #35278 (Multiple virtual() calls crash Apache 2 php module). (Ilia)
67
- Fixed bug #35273 (Error in mapping soap - java types). (Dmitry)

ext/pdo/pdo_dbh.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ static PHP_METHOD(PDO, prepare)
503503
PDO_CONSTRUCT_CHECK;
504504

505505
if (ZEND_NUM_ARGS() > 1 && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(options), PDO_ATTR_STATEMENT_CLASS, (void**)&opt)) {
506-
if (zend_hash_index_find(Z_ARRVAL_PP(opt), 0, (void**)&item) == FAILURE
506+
if (Z_TYPE_PP(opt) != IS_ARRAY || zend_hash_index_find(Z_ARRVAL_PP(opt), 0, (void**)&item) == FAILURE
507507
|| Z_TYPE_PP(item) != IS_STRING
508508
|| zend_lookup_class(Z_STRVAL_PP(item), Z_STRLEN_PP(item), &pce TSRMLS_CC) == FAILURE
509509
) {

0 commit comments

Comments
 (0)