Permalink
Browse files

MFH

  • Loading branch information...
rlerdorf committed Jul 15, 2009
1 parent 6f9c84f commit 33c42127f6a560326234f838cf4f1dc83bdde63a
Showing with 11 additions and 0 deletions.
  1. +11 −0 ext/mssql/php_mssql.c
View
@@ -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:

0 comments on commit 33c4212

Please sign in to comment.