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 = T_A;
else if (!strcasecmp("NS", rectype)) type = DNS_T_NS;
--- /dev/null
+--TEST--
+dns_check_record() segfault with empty host
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die('No windows support');
+}
+?>
+--FILE--
+<?php
+var_dump(dns_check_record(''));
+?>
+--EXPECTF--
+Warning: dns_check_record(): Host cannot be empty in %s on line %d
+bool(false)