rasmus          Wed, 15 Jul 2009 19:05:09 +0000

URL: http://svn.php.net/viewvc?view=revision&revision=284144

Changed paths:
        U   php/php-src/trunk/ext/mssql/php_mssql.c

Log:
Limit connection strings to 255 chars here


Modified: php/php-src/trunk/ext/mssql/php_mssql.c
===================================================================
--- php/php-src/trunk/ext/mssql/php_mssql.c     2009-07-15 18:40:32 UTC (rev 
284143)
+++ php/php-src/trunk/ext/mssql/php_mssql.c     2009-07-15 19:05:09 UTC (rev 
284144)
@@ -550,6 +550,17 @@
                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:

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to