summaryrefslogtreecommitdiff
path: root/ext/mssql/php_mssql.c
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2010-01-07 13:31:53 +0100
committerOndřej Surý <ondrej@sury.org>2010-01-07 13:31:53 +0100
commit0fab6db7cac8d2be99579dd049f812a8ff98e74f (patch)
tree91f01b0d06916c78262404096bfd466b8e95e5b5 /ext/mssql/php_mssql.c
parentd3a8757891280dc6650ca7eead67830c794b0e7b (diff)
downloadphp-0fab6db7cac8d2be99579dd049f812a8ff98e74f.tar.gz
Imported Upstream version 5.3.1upstream/5.3.1
Diffstat (limited to 'ext/mssql/php_mssql.c')
-rw-r--r--ext/mssql/php_mssql.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c
index 0f6abf1c5..74d89dd6d 100644
--- a/ext/mssql/php_mssql.c
+++ b/ext/mssql/php_mssql.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_mssql.c,v 1.152.2.13.2.4.2.23 2009/05/26 12:35:46 felipe Exp $ */
+/* $Id: php_mssql.c 284145 2009-07-15 19:09:15Z rasmus $ */
#ifdef COMPILE_DL_MSSQL
#define HAVE_MSSQL 1
@@ -550,6 +550,17 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
return;
}
+ /* Limit strings to 255 chars to prevent overflow issues in underlying libraries */
+ if(host_len>255) {
+ host[255] = '\0';
+ }
+ if(user_len>255) {
+ user[255] = '\0';
+ }
+ if(passwd_len>255) {
+ passwd[255] = '\0';
+ }
+
switch(ZEND_NUM_ARGS())
{
case 0: