mirror of
https://github.com/php/php-src.git
synced 2025-01-15 00:05:02 +08:00
MFB51: Fixed bug #35303 (PDO prepare() crashes with invalid parameters).
This commit is contained in:
parent
895e795b53
commit
9979ac2215
@ -508,7 +508,7 @@ static PHP_METHOD(PDO, prepare)
|
||||
PDO_CONSTRUCT_CHECK;
|
||||
|
||||
if (ZEND_NUM_ARGS() > 1 && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(options), PDO_ATTR_STATEMENT_CLASS, (void**)&opt)) {
|
||||
if (zend_hash_index_find(Z_ARRVAL_PP(opt), 0, (void**)&item) == FAILURE
|
||||
if (Z_TYPE_PP(opt) != IS_ARRAY || zend_hash_index_find(Z_ARRVAL_PP(opt), 0, (void**)&item) == FAILURE
|
||||
|| !PDO_ZVAL_PP_IS_TEXT(item)
|
||||
|| zend_u_lookup_class(Z_TYPE_PP(item), Z_UNIVAL_PP(item), Z_UNILEN_PP(item), &pce TSRMLS_CC) == FAILURE
|
||||
) {
|
||||
|
Loading…
Reference in New Issue
Block a user