pollita Mon Sep 1 18:37:46 2003 EDT
Modified files: (Branch: PHP_4_3)
/php-src/ext/standard dns.c
Log:
Plug leak when invalid domain name provided.
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.44.2.3 php-src/ext/standard/dns.c:1.44.2.4
--- php-src/ext/standard/dns.c:1.44.2.3 Thu Feb 20 00:35:18 2003
+++ php-src/ext/standard/dns.c Mon Sep 1 18:37:46 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dns.c,v 1.44.2.3 2003/02/20 05:35:18 sniper Exp $ */
+/* $Id: dns.c,v 1.44.2.4 2003/09/01 22:37:46 pollita Exp $ */
/* {{{ includes
*/
@@ -174,12 +174,12 @@
}
convert_to_string_ex(arg);
- array_init(return_value);
-
hp = gethostbyname(Z_STRVAL_PP(arg));
if (hp == NULL || hp->h_addr_list == NULL) {
RETURN_FALSE;
}
+
+ array_init(return_value);
for (i = 0 ; hp->h_addr_list[i] != 0 ; i++) {
in = *(struct in_addr *) hp->h_addr_list[i];
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php