Skip to content

Commit

Permalink
- unify warning between win and unix and enable test
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrejoye committed Sep 4, 2011
1 parent d1b156f commit 7e5d921
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 5 additions & 0 deletions ext/standard/dns_win32.c
Expand Up @@ -103,6 +103,11 @@ PHP_FUNCTION(dns_check_record)
return; return;
} }


if (hostname_len == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host cannot be empty");
RETURN_FALSE;
}

if (rectype) { if (rectype) {
if (!strcasecmp("A", rectype)) type = DNS_TYPE_A; if (!strcasecmp("A", rectype)) type = DNS_TYPE_A;
else if (!strcasecmp("NS", rectype)) type = DNS_TYPE_NS; else if (!strcasecmp("NS", rectype)) type = DNS_TYPE_NS;
Expand Down
6 changes: 0 additions & 6 deletions ext/standard/tests/network/bug41347.phpt
@@ -1,11 +1,5 @@
--TEST-- --TEST--
dns_check_record() segfault with empty host dns_check_record() segfault with empty host
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip No windows support');
}
?>
--FILE-- --FILE--
<?php <?php
var_dump(dns_check_record('')); var_dump(dns_check_record(''));
Expand Down

0 comments on commit 7e5d921

Please sign in to comment.