diff options
Diffstat (limited to 'ext/standard/dns.c')
| -rw-r--r-- | ext/standard/dns.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/standard/dns.c b/ext/standard/dns.c index 7cb16bc0a..d72029371 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dns.c,v 1.70.2.7.2.2 2007/02/24 02:17:27 helly Exp $ */ +/* $Id: dns.c,v 1.70.2.7.2.4 2007/05/14 11:33:34 tony2001 Exp $ */ /* {{{ includes */ #include "php.h" @@ -264,6 +264,11 @@ PHP_FUNCTION(dns_check_record) } type = T_MX; convert_to_string_ex(arg1); + + if (Z_STRLEN_PP(arg1) == 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host cannot be empty"); + RETURN_FALSE; + } break; case 2: @@ -273,6 +278,11 @@ PHP_FUNCTION(dns_check_record) convert_to_string_ex(arg1); convert_to_string_ex(arg2); + if (Z_STRLEN_PP(arg1) == 0 || Z_STRLEN_PP(arg2) == 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host and type cannot be empty"); + RETURN_FALSE; + } + if (!strcasecmp("A", Z_STRVAL_PP(arg2))) type = T_A; else if (!strcasecmp("NS", Z_STRVAL_PP(arg2))) type = DNS_T_NS; else if (!strcasecmp("MX", Z_STRVAL_PP(arg2))) type = DNS_T_MX; |
