com php-src: Fixed bug #68964 Allowed memory size exhausted with odbc_exec: ext/odbc/config.m4 ext/odbc/config.w 32 ext/odbc/php_odbc.h
ext/odbc/php_odbc_includ es.h
| From: | Anatol Belski | Date: | Fri, 06 Feb 2015 18:00:27 +0000 |
| Subject: | com php-src: Fixed bug #68964 Allowed memory size exhausted with odbc_exec: ext/odbc/config.m4 ext/odbc/config.w 32 ext/odbc/php_odbc.h ext/odbc/php_odbc_includ es.h |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84686@lists.php.net to get a copy of this message | ||
Commit: a41aa46759d20e23af92df00b917ca66c6102412
Author: Anatol Belski <ab@php.net> Fri, 6 Feb 2015 19:00:27 +0100
Parents: 9ef0c39b2b9e1a8212a953aee9deee26f0978ce8
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a41aa46759d20e23af92df00b917ca66c6102412
Log:
Fixed bug #68964 Allowed memory size exhausted with odbc_exec
This is done in two steps:
- the ODBCVER has to be rased to 0x0300 which corresponds to Sql
Server 9, otherwise the client will not recognize several SQL
datatypes
- additionally the config scripts was tweaked so then ODBCVER
can be overridden, that still allows enabling compatibility
with lower versions
Bug #67437 might be fixed by this as well.
Bugs:
https://bugs.php..net/68964
https://bugs.php.net/67437
Changed paths:
M ext/odbc/config.m4
M ext/odbc/config.w32
M ext/odbc/php_odbc.h
M ext/odbc/php_odbc_includes.h
Diff:
diff --git a/ext/odbc/config.m4 b/ext/odbc/config.m4
index eaed212..f79c461 100644
--- a/ext/odbc/config..m4
+++ b/ext/odbc/config.m4
@@ -490,6 +490,19 @@ PHP_ARG_WITH(dbmaker,,
fi
fi
+PHP_ARG_WITH(odbcver,,
+[ --with-odbcver[=HEX] Force support for the passed ODBC version. A hex number is expected,
default 0x0300.
+ Use the special value of 0 to prevent an explicit ODBCVER to be
defined. ], 0x0300)
+
+if test "no" != "$PHP_ODBCVER"; then
+ if test "$PHP_ODBCVER" != "0"; then
+ AC_DEFINE_UNQUOTED(ODBCVER, $PHP_ODBCVER, [ The highest supported ODBC version ])
+ fi
+else
+ AC_DEFINE(ODBCVER, 0x300, [ The highest supported ODBC version ])
+fi
+
+
dnl
dnl Extension setup
dnl
diff --git a/ext/odbc/config.w32 b/ext/odbc/config.w32
index 2395ddc..70a541f 100644
--- a/ext/odbc/config.w32
+++ b/ext/odbc/config.w32
@@ -2,6 +2,7 @@
// vim:ft=javascript
ARG_ENABLE("odbc", "ODBC support", "yes");
+ARG_WITH("odbcver", "Force support for the passed ODBC version. A hex number is
expected, default 0x0300. Use the special value of 0 to prevent an explicit ODBCVER to be
defined.");
if (PHP_ODBC == "yes") {
if (CHECK_LIB("odbc32.lib", "odbc") &&
CHECK_LIB("odbccp32.lib", "odbc")
@@ -9,8 +10,13 @@ if (PHP_ODBC == "yes") {
&& CHECK_HEADER_ADD_INCLUDE("sqlext.h", "CFLAGS_ODBC")) {
EXTENSION("odbc", "php_odbc.c");
AC_DEFINE("HAVE_UODBC", 1, "ODBC support");
+ if ("no" == PHP_ODBCVER) {
+ AC_DEFINE("ODBCVER", "0x0300", "The highest supported ODBC
version", false);
+ } else if ("0" != PHP_ODBCVER) {
+ AC_DEFINE("ODBCVER", PHP_ODBCVER, "The highest supported ODBC version",
false);
+ }
} else {
WARNING("odbc support can't be enabled, libraries or header are missing (SDK)")
PHP_ODBC = "no"
}
-}
\ No newline at end of file
+}
diff --git a/ext/odbc/php_odbc.h b/ext/odbc/php_odbc.h
index b4d279c..dca1496 100644
--- a/ext/odbc/php_odbc.h
+++ b/ext/odbc/php_odbc.h
@@ -24,7 +24,6 @@
#define PHP_ODBC_H
#if HAVE_UODBC
-#define ODBCVER 0x0250
#ifdef ZTS
#include "TSRM.h"
diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h
index 84c4afc..15bb737 100644
--- a/ext/odbc/php_odbc_includes.h
+++ b/ext/odbc/php_odbc_includes.h
@@ -25,12 +25,6 @@
#if HAVE_UODBC
-#define ODBCVER 0x0250
-/*#ifndef MSVC5
-#define FAR
-#endif
-*/
-
/* checking in the same order as in configure.in */
#if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) || defined(HAVE_SOLID_35) /* Solid Server */