Skip to content

Commit e82b3b2

Browse files
authored
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.
1 parent 68537fd commit e82b3b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/pdo_firebird/firebird_driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ void php_firebird_set_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *state,
535535
einfo->errmsg_length = 0;
536536
}
537537

538-
if (H->isc_status && (H->isc_status[0] == 1 && H->isc_status[1] > 0)) {
538+
if (H->isc_status[0] == 1 && H->isc_status[1] > 0) {
539539
char buf[512];
540540
size_t buf_size = sizeof(buf), read_len = 0;
541541
ssize_t tmp_len;
@@ -557,7 +557,7 @@ void php_firebird_set_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *state,
557557

558558
char sqlstate[sizeof(pdo_error_type)];
559559
fb_sqlstate(sqlstate, H->isc_status);
560-
if (sqlstate != NULL && strlen(sqlstate) < sizeof(pdo_error_type)) {
560+
if (strlen(sqlstate) < sizeof(pdo_error_type)) {
561561
strcpy(*error_code, sqlstate);
562562
goto end;
563563
}

0 commit comments

Comments
 (0)