From 0d4bf4110f7c3e61b1ad68baec5dcd728b0526ca Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Sun, 13 Dec 2009 19:53:44 +0000 Subject: [PATCH] - Fixed bug #49174 (crash on queryString set) --- NEWS | 1 + ext/pdo/pdo_dbh.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index c1a999ff23..c8657facf8 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ PHP NEWS seg fault). (davbrown4 at yahoo dot com, Felipe) - Fixed bug #50209 (Compiling with libedit cannot find readline.h). (tcallawa at redhat dot com) +- Fixed bug #49174 (crash on queryString set). (Felipe) 10 Dec 2009, PHP 5.2.12RC4 - Added LIBXML_PARSEHUGE constant to overrides the maximum text size of a diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 3f190c1212..c389458ad5 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; -- 2.40.0