|
|
af9dc8 |
Backported from 5.5.14
|
|
|
af9dc8 |
Adapted for PHP 5.4.16 from
|
|
|
af9dc8 |
|
|
|
af9dc8 |
From a05611358606ca21672c49d26c77b7b0c81cab07 Mon Sep 17 00:00:00 2001
|
|
|
af9dc8 |
From: Felipe Pena <felipensp@gmail.com>
|
|
|
af9dc8 |
Date: Sun, 22 Dec 2013 09:42:45 -0200
|
|
|
af9dc8 |
Subject: [PATCH] - Fixed bug #66311 (Stack smashing protection kills PDO/ODBC
|
|
|
af9dc8 |
queries) patch by: michael at orlitzky dot com
|
|
|
af9dc8 |
|
|
|
af9dc8 |
---
|
|
|
af9dc8 |
ext/pdo_odbc/odbc_stmt.c | 3 ++-
|
|
|
af9dc8 |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
af9dc8 |
|
|
|
af9dc8 |
diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c
|
|
|
af9dc8 |
index 89b6721..e0d7e62 100644
|
|
|
af9dc8 |
--- a/ext/pdo_odbc/odbc_stmt.c
|
|
|
af9dc8 |
+++ b/ext/pdo_odbc/odbc_stmt.c
|
|
|
af9dc8 |
@@ -546,7 +546,8 @@ static int odbc_stmt_describe(pdo_stmt_t
|
|
|
af9dc8 |
zend_bool dyn = FALSE;
|
|
|
af9dc8 |
RETCODE rc;
|
|
|
af9dc8 |
SWORD colnamelen;
|
|
|
af9dc8 |
- SDWORD colsize, displaysize;
|
|
|
af9dc8 |
+ SDWORD colsize;
|
|
|
af9dc8 |
+ SQLLEN displaysize;
|
|
|
af9dc8 |
|
|
|
af9dc8 |
rc = SQLDescribeCol(S->stmt, colno+1, S->cols[colno].colname,
|
|
|
af9dc8 |
sizeof(S->cols[colno].colname)-1, &colnamelen,
|
|
|
af9dc8 |
|
|
|
af9dc8 |
From 186ffcb72c982b0235761bdd6388ff1c36d79568 Mon Sep 17 00:00:00 2001
|
|
|
af9dc8 |
From: Andrew Kehrig <kehrigan@gmail.com>
|
|
|
af9dc8 |
Date: Mon, 24 Feb 2014 12:01:58 -0500
|
|
|
af9dc8 |
Subject: [PATCH] Fix #50444: PDO-ODBC changes for 64-bit
|
|
|
af9dc8 |
|
|
|
af9dc8 |
This bug is also referenced in
|
|
|
af9dc8 |
[#61777](https://bugs.php.net/bug.php?id=61777) and is still present in
|
|
|
af9dc8 |
the latest stable release of the 5.5 branch. I see two tickets exist for
|
|
|
af9dc8 |
this problem already, and I'm just submitting these changes via github
|
|
|
af9dc8 |
as a reminder that this is a serious problem for anyone using PDO_ODBC
|
|
|
af9dc8 |
on the x64 builds.
|
|
|
af9dc8 |
---
|
|
|
af9dc8 |
NEWS | 3 +++
|
|
|
af9dc8 |
ext/pdo_odbc/odbc_stmt.c | 4 ++--
|
|
|
af9dc8 |
ext/pdo_odbc/php_pdo_odbc_int.h | 2 +-
|
|
|
af9dc8 |
3 files changed, 6 insertions(+), 3 deletions(-)
|
|
|
af9dc8 |
|
|
|
af9dc8 |
diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c
|
|
|
af9dc8 |
index 8b0ccf3..1d275cd 100644
|
|
|
af9dc8 |
--- a/ext/pdo_odbc/odbc_stmt.c
|
|
|
af9dc8 |
+++ b/ext/pdo_odbc/odbc_stmt.c
|
|
|
af9dc8 |
@@ -279,7 +279,7 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p
|
|
|
af9dc8 |
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
|
|
|
af9dc8 |
RETCODE rc;
|
|
|
af9dc8 |
SWORD sqltype = 0, ctype = 0, scale = 0, nullable = 0;
|
|
|
af9dc8 |
- UDWORD precision = 0;
|
|
|
af9dc8 |
+ SQLULEN precision = 0;
|
|
|
af9dc8 |
pdo_odbc_param *P;
|
|
|
af9dc8 |
|
|
|
af9dc8 |
/* we're only interested in parameters for prepared SQL right now */
|
|
|
af9dc8 |
@@ -546,7 +546,7 @@ static int odbc_stmt_describe(pdo_stmt_t
|
|
|
af9dc8 |
zend_bool dyn = FALSE;
|
|
|
af9dc8 |
RETCODE rc;
|
|
|
af9dc8 |
SWORD colnamelen;
|
|
|
af9dc8 |
- SDWORD colsize;
|
|
|
af9dc8 |
+ SQLULEN colsize;
|
|
|
af9dc8 |
SQLLEN displaysize;
|
|
|
af9dc8 |
|
|
|
af9dc8 |
rc = SQLDescribeCol(S->stmt, colno+1, S->cols[colno].colname,
|
|
|
af9dc8 |
diff --git a/ext/pdo_odbc/php_pdo_odbc_int.h b/ext/pdo_odbc/php_pdo_odbc_int.h
|
|
|
af9dc8 |
index 87b2f91..5e42951 100644
|
|
|
af9dc8 |
--- a/ext/pdo_odbc/php_pdo_odbc_int.h
|
|
|
af9dc8 |
+++ b/ext/pdo_odbc/php_pdo_odbc_int.h
|
|
|
af9dc8 |
@@ -157,7 +157,7 @@ typedef struct {
|
|
|
af9dc8 |
} pdo_odbc_stmt;
|
|
|
af9dc8 |
|
|
|
af9dc8 |
typedef struct {
|
|
|
af9dc8 |
- SQLINTEGER len;
|
|
|
af9dc8 |
+ SQLLEN len;
|
|
|
af9dc8 |
SQLSMALLINT paramtype;
|
|
|
af9dc8 |
char *outbuf;
|
|
|
af9dc8 |
unsigned is_unicode:1;
|
|
|
af9dc8 |
--
|
|
|
af9dc8 |
2.1.4
|
|
|
af9dc8 |
|