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.3.2RC1~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93a406ac9ca76689e4206bfc98462cf6a48afe84;p=php - Fixed bug #49174 (crash on queryString set) --- diff --git a/NEWS b/NEWS index ad2ce231d5..b2ed1d9550 100644 --- a/NEWS +++ b/NEWS @@ -116,6 +116,7 @@ PHP NEWS - Fixed bug #49244 (Floating point NaN cause garbage characters). (Sjoerd) - Fixed bug #49224 (Compile error due to old DNS functions on AIX systems). (Scott) +- Fixed bug #49174 (crash on queryString set). (Felipe) - Fixed bug #47848 (importNode doesn't preserve attribute namespaces). (Rob) - Fixed bug #45120 (PDOStatement->execute() returns true then false for same statement). (Pierrick) diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 7f81d9408a..2564587e46 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;