summaryrefslogtreecommitdiff
path: root/ext/pdo_firebird
diff options
context:
space:
mode:
authorPopa Adrian Marius <mariuz@php.net>2011-12-28 10:17:17 (GMT)
committerPopa Adrian Marius <mariuz@php.net>2011-12-28 10:17:17 (GMT)
commit9e06b7f41db61bb285d5c3b2ec094c9ee2aaee7f (patch)
treea29b2e6b16368649ba66bca94b40f969dbf4b841 /ext/pdo_firebird
parent6e3f7b800d819de2cbc62707558fcb992c15f5c3 (diff)
downloadphp-9e06b7f41db61bb285d5c3b2ec094c9ee2aaee7f.tar.gz
fix Bug #47415 PDO_Firebird segfaults when passing lowercased column name to bindColumn()
Diffstat (limited to 'ext/pdo_firebird')
-rw-r--r--ext/pdo_firebird/firebird_statement.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c
index 6dcd09c..d52850b 100644
--- a/ext/pdo_firebird/firebird_statement.c
+++ b/ext/pdo_firebird/firebird_statement.c
@@ -582,6 +582,9 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
break;
case PDO_PARAM_EVT_FETCH_POST:
+ if (param->paramno == -1) {
+ return 0;
+ }
value = NULL;
value_len = 0;
caller_frees = 0;
@@ -598,6 +601,15 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
ZVAL_LONG(param->parameter, *(long*)value);
break;
}
+ case PDO_PARAM_EVT_NORMALIZE:
+ if (!param->is_param) {
+ char *s = param->name;
+ while (*s != '\0') {
+ *s = toupper(*s);
+ s++;
+ }
+ }
+ break;
default:
ZVAL_NULL(param->parameter);
}