Skip to content

Commit cc20351

Browse files
committed
Fixes bug #66071: isc_interprete is unsafe and deprecated , it is replaced with fb_iterpret
1 parent a0beddf commit cc20351

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/pdo_firebird/firebird_driver.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -607,14 +607,14 @@ static int firebird_handle_get_attribute(pdo_dbh_t *dbh, long attr, zval *val TS
607607
static int pdo_firebird_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) /* {{{ */
608608
{
609609
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
610-
ISC_STATUS *s = H->isc_status;
610+
const ISC_STATUS *s = H->isc_status;
611611
char buf[400];
612612
long i = 0, l, sqlcode = isc_sqlcode(s);
613613

614614
if (sqlcode) {
615615
add_next_index_long(info, sqlcode);
616616

617-
while ((l = isc_interprete(&buf[i],&s))) {
617+
while ((sizeof(buf)>(i+2))&&(l = fb_interpret(&buf[i],(sizeof(buf)-i-2),&s))) {
618618
i += l;
619619
strcpy(&buf[i++], " ");
620620
}
@@ -697,8 +697,8 @@ static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRM
697697

698698
if (!dbh->methods) {
699699
char errmsg[512];
700-
ISC_STATUS *s = H->isc_status;
701-
isc_interprete(errmsg, &s);
700+
const ISC_STATUS *s = H->isc_status;
701+
fb_interpret(errmsg, sizeof(errmsg),&s);
702702
zend_throw_exception_ex(php_pdo_get_exception(), H->isc_status[1] TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
703703
"HY000", H->isc_status[1], errmsg);
704704
}

0 commit comments

Comments
 (0)