php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #66071
Patch fb_interpret revision 2013-11-10 05:40 UTC by slavb18 at gmail dot com
revision 2013-11-09 07:08 UTC by slavb18 at gmail dot com

Patch fb_interpret for PDO Firebird Bug #66071

Patch version 2013-11-10 05:40 UTC

Return to Bug #66071 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: slavb18@gmail.com

--- ext/pdo_firebird/firebird_driver.c.orig	2013-09-18 09:48:57.000000000 +0400
+++ ext/pdo_firebird/firebird_driver.c	2013-11-10 09:34:15.000000000 +0400
@@ -607,14 +607,14 @@
 static int pdo_firebird_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) /* {{{ */
 {       
 	pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
-	ISC_STATUS *s = H->isc_status;
+	const ISC_STATUS *s = H->isc_status;
 	char buf[400];
 	long i = 0, l, sqlcode = isc_sqlcode(s);
 
 	if (sqlcode) {
 		add_next_index_long(info, sqlcode);
 
-		while ((l = isc_interprete(&buf[i],&s))) {
+		while ((sizeof(buf)>(i+2))&&(l = fb_interpret(&buf[i],(sizeof(buf)-i-2),&s))) {
 			i += l;
 			strcpy(&buf[i++], " ");
 		}
@@ -697,8 +697,8 @@
 
 	if (!dbh->methods) {
 		char errmsg[512];
-		ISC_STATUS *s = H->isc_status;
-		isc_interprete(errmsg, &s);
+		const ISC_STATUS *s = H->isc_status;
+		fb_interpret(errmsg, sizeof(errmsg),&s);
 		zend_throw_exception_ex(php_pdo_get_exception(), H->isc_status[1] TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
 				"HY000", H->isc_status[1], errmsg);
 	}
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Oct 21 22:01:23 2020 UTC