From: Felipe Pena Date: Sun, 13 Dec 2009 19:53:44 +0000 (+0000) Subject: - Fixed bug #49174 (crash on queryString set) X-Git-Tag: php-5.4.0alpha1~191^2~2232 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=05859f7fc728a5760e0b490893cce3c2fae3e392;p=php - Fixed bug #49174 (crash on queryString set) --- diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 32dfa0ee51..2050ab224d 100755 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -44,7 +44,7 @@ void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate char *message = NULL; const char *msg; - if (dbh->error_mode == PDO_ERRMODE_SILENT) { + if (dbh && dbh->error_mode == PDO_ERRMODE_SILENT) { #if 0 /* BUG: if user is running in silent mode and hits an error at the driver level * when they use the PDO methods to call up the error information, they may @@ -71,7 +71,7 @@ void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate spprintf(&message, 0, "SQLSTATE[%s]: %s", *pdo_err, msg); } - if (dbh->error_mode != PDO_ERRMODE_EXCEPTION) { + if (dbh && dbh->error_mode != PDO_ERRMODE_EXCEPTION) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message); } else { zval *ex, *info;