summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2015-06-19 15:17:56 +0900
committerFerenc Kovacs <tyrael@php.net>2015-07-09 11:25:33 +0200
commit57747d08e777970c9cfe866b7e4acf5227f17772 (patch)
tree3a001d312321e06dfe9853487c3d3f92d5d10dac
parent145c6167619b7a2102843d4363337b55bc9916ff (diff)
downloadphp-git-57747d08e777970c9cfe866b7e4acf5227f17772.tar.gz
Move strlen() check to php_mail_detect_multiple_crlf()
-rw-r--r--ext/standard/mail.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index 6803f4d80c..a1f1906e0c 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -226,7 +226,7 @@ void php_mail_log_to_file(char *filename, char *message, size_t message_size TSR
static int php_mail_detect_multiple_crlf(char *hdr) {
/* This function detects multiple/malformed multiple newlines. */
- if (!hdr) {
+ if (!hdr || !strlen(hdr)) {
return 0;
}
@@ -329,7 +329,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);
}