MFB ?

On 05/10/2007 05:16 PM, Scott MacVicar wrote:
scottmac                Thu May 10 13:16:54 2007 UTC

  Added files:                 (Branch: PHP_5_2)
/php-src/ext/standard/tests/network bug41347.phpt Modified files: /php-src/ext/standard dns.c Log:
  Fixed bug #41347 (checkdnsrr() segfaults on empty hostname).
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.2&r2=1.70.2.7.2.3&diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.2 
php-src/ext/standard/dns.c:1.70.2.7.2.3
--- php-src/ext/standard/dns.c:1.70.2.7.2.2     Sat Feb 24 02:17:27 2007
+++ php-src/ext/standard/dns.c  Thu May 10 13:16:54 2007
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
-/* $Id: dns.c,v 1.70.2.7.2.2 2007/02/24 02:17:27 helly Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.3 2007/05/10 13:16:54 scottmac Exp $ */
/* {{{ includes */
 #include "php.h"
@@ -264,6 +264,12 @@
                        }
                        type = T_MX;
                        convert_to_string_ex(arg1);
+                       
+                       if (Z_STRLEN_PP(arg1) == 0)
+                       {
+                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host 
cannot be empty");
+                               RETURN_FALSE;
+                       }
                        break;
case 2:
@@ -273,6 +279,12 @@
                        convert_to_string_ex(arg1);
                        convert_to_string_ex(arg2);
+ if (Z_STRLEN_PP(arg1) == 0 || Z_STRLEN_PP(arg2) == 0)
+                       {
+                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host 
and type cannot be empty");
+                               RETURN_FALSE;
+                       }
+
                        if (!strcasecmp("A", Z_STRVAL_PP(arg2))) type = T_A;
                        else if (!strcasecmp("NS",    Z_STRVAL_PP(arg2))) type 
= DNS_T_NS;
                        else if (!strcasecmp("MX",    Z_STRVAL_PP(arg2))) type 
= DNS_T_MX;

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/network/bug41347.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/network/bug41347.phpt
+++ php-src/ext/standard/tests/network/bug41347.phpt



--
Wbr, Antony Dovgal

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

Reply via email to