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