summaryrefslogtreecommitdiff
path: root/ext/mssql/php_mssql.c
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2009-07-15 19:09:15 +0000
committerRasmus Lerdorf <rasmus@php.net>2009-07-15 19:09:15 +0000
commit33c42127f6a560326234f838cf4f1dc83bdde63a (patch)
treea2fa4bc2bc7777246c474c752303934b7473e0ca /ext/mssql/php_mssql.c
parent6f9c84f84448e076a37b9957a702a549e5bd1600 (diff)
downloadphp-git-33c42127f6a560326234f838cf4f1dc83bdde63a.tar.gz
MFH
Diffstat (limited to 'ext/mssql/php_mssql.c')
-rw-r--r--ext/mssql/php_mssql.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c
index dedf6dd173..299005cfc1 100644
--- a/ext/mssql/php_mssql.c
+++ b/ext/mssql/php_mssql.c
@@ -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: