summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2011-09-04 21:48:22 +0000
committerPierre Joye <pajoye@php.net>2011-09-04 21:48:22 +0000
commit7e5d92106b6048fae001e718f2a5423544992d49 (patch)
treea9b21cffda72f91905f5d16e29826ce77f091020
parentd1b156f1be8234b491af766329e79aab41c8549f (diff)
downloadphp-git-7e5d92106b6048fae001e718f2a5423544992d49.tar.gz
- unify warning between win and unix and enable test
-rw-r--r--ext/standard/dns_win32.c5
-rw-r--r--ext/standard/tests/network/bug41347.phpt6
2 files changed, 5 insertions, 6 deletions
diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c
index 7bded1cdaf..2dbf3e2e1d 100644
--- a/ext/standard/dns_win32.c
+++ b/ext/standard/dns_win32.c
@@ -103,6 +103,11 @@ PHP_FUNCTION(dns_check_record)
return;
}
+ if (hostname_len == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host cannot be empty");
+ RETURN_FALSE;
+ }
+
if (rectype) {
if (!strcasecmp("A", rectype)) type = DNS_TYPE_A;
else if (!strcasecmp("NS", rectype)) type = DNS_TYPE_NS;
diff --git a/ext/standard/tests/network/bug41347.phpt b/ext/standard/tests/network/bug41347.phpt
index 21fc002fa5..6ece098191 100644
--- a/ext/standard/tests/network/bug41347.phpt
+++ b/ext/standard/tests/network/bug41347.phpt
@@ -1,11 +1,5 @@
--TEST--
dns_check_record() segfault with empty host
---SKIPIF--
-<?php
-if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip No windows support');
-}
-?>
--FILE--
<?php
var_dump(dns_check_record(''));