]> granicus.if.org Git - php/commitdiff
Move strlen() check to php_mail_detect_multiple_crlf()
authorYasuo Ohgaki <yohgaki@php.net>
Fri, 19 Jun 2015 06:17:56 +0000 (15:17 +0900)
committerYasuo Ohgaki <yohgaki@php.net>
Fri, 19 Jun 2015 06:17:56 +0000 (15:17 +0900)
ext/standard/mail.c

index 1c1332b55e26e05e509e740244079ea20f85c11f..aa29a22c85a9a63ee7e0b486b004a02b8471d552 100644 (file)
@@ -225,7 +225,7 @@ static int php_mail_detect_multiple_crlf(char *hdr) {
        /* This function detects multiple/malformed multiple newlines. */
        size_t len;
 
-       if (!hdr) {
+       if (!hdr || !strlen(hdr)) {
                return 0;
        }
 
@@ -320,7 +320,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
                efree(f);
        }
 
-       if (hdr && strlen(hdr) && php_mail_detect_multiple_crlf(hdr)) {
+       if (hdr && php_mail_detect_multiple_crlf(hdr)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Multiple or malformed newlines found in additional_header");
                MAIL_RET(0);
        }