]> granicus.if.org Git - php/commitdiff
Fixed bug #34777 (Crash in dblib when fetching non-existent error info).
authorIlia Alshanetsky <iliaa@php.net>
Sun, 9 Oct 2005 18:59:27 +0000 (18:59 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 9 Oct 2005 18:59:27 +0000 (18:59 +0000)
ext/pdo_dblib/dblib_driver.c

index c3065b92bc1bf713d5af3f7e53d62bf12409a8f3..996b0034c8978522c5fdb997a17dff23d595ee36 100644 (file)
@@ -61,7 +61,9 @@ static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS
        add_next_index_string(info, message, 0);
        add_next_index_long(info, einfo->oserr);
        add_next_index_long(info, einfo->severity);
-       add_next_index_string(info, einfo->oserrstr, 1);
+       if (einfo->oserrstr) {
+               add_next_index_string(info, einfo->oserrstr, 1);
+       }
 
        return 1;
 }