From 79bbcf709b96099b1357b07012d18352b232b02b Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 29 Sep 2024 00:35:39 +0200 Subject: [PATCH] Remove non-sensical checks from firebird These conditions are always true because they are arrays that are address-taken, i.e. their addresses will never be NULL. --- ext/pdo_firebird/firebird_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c index 0a54bf90e7bcd..23f17914dcd76 100644 --- a/ext/pdo_firebird/firebird_driver.c +++ b/ext/pdo_firebird/firebird_driver.c @@ -535,7 +535,7 @@ void php_firebird_set_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *state, einfo->errmsg_length = 0; } - if (H->isc_status && (H->isc_status[0] == 1 && H->isc_status[1] > 0)) { + if (H->isc_status[0] == 1 && H->isc_status[1] > 0) { char buf[512]; size_t buf_size = sizeof(buf), read_len = 0; ssize_t tmp_len; @@ -557,7 +557,7 @@ void php_firebird_set_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *state, char sqlstate[sizeof(pdo_error_type)]; fb_sqlstate(sqlstate, H->isc_status); - if (sqlstate != NULL && strlen(sqlstate) < sizeof(pdo_error_type)) { + if (strlen(sqlstate) < sizeof(pdo_error_type)) { strcpy(*error_code, sqlstate); goto end; }