Skip to content

Commit f2b7aed

Browse files
datibbawsmalyshev
authored andcommitted
Fix #53092 - dns_get_record does not return false on dns server failure
1 parent 2534671 commit f2b7aed

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ext/standard/dns.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,13 @@ PHP_FUNCTION(dns_get_record)
896896

897897
if (n < 0) {
898898
php_dns_free_handle(handle);
899-
continue;
899+
if (h_errno == NO_DATA) {
900+
continue;
901+
} else {
902+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dns Query failed");
903+
zval_dtor(return_value);
904+
RETURN_FALSE;
905+
}
900906
}
901907

902908
cp = answer.qb2 + HFIXEDSZ;

0 commit comments

Comments
 (0)