]> granicus.if.org Git - php/commitdiff
- Fixed bug #49174 (crash on queryString set)
authorFelipe Pena <felipe@php.net>
Sun, 13 Dec 2009 19:53:44 +0000 (19:53 +0000)
committerFelipe Pena <felipe@php.net>
Sun, 13 Dec 2009 19:53:44 +0000 (19:53 +0000)
ext/pdo/pdo_dbh.c

index 32dfa0ee512d37178ded240261730376041c35c0..2050ab224d3944b946093e3fdba6fcc20b67ee5d 100755 (executable)
@@ -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;