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