Remove non-sensical checks from firebird (#16114)

These conditions are always true because they are arrays that are
address-taken, i.e. their addresses will never be NULL.
This commit is contained in:
Niels Dossche 2024-09-29 11:31:25 +02:00 committed by GitHub
parent 68537fd9f4
commit e82b3b2dd5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -535,7 +535,7 @@ void php_firebird_set_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *state,
einfo->errmsg_length = 0; 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]; char buf[512];
size_t buf_size = sizeof(buf), read_len = 0; size_t buf_size = sizeof(buf), read_len = 0;
ssize_t tmp_len; 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)]; char sqlstate[sizeof(pdo_error_type)];
fb_sqlstate(sqlstate, H->isc_status); 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); strcpy(*error_code, sqlstate);
goto end; goto end;
} }