Skip to content

Commit a2564f7

Browse files
committed
revert marking sendmail_cmd as const
It is used as a target for snprintf, so must be mutable
1 parent fb66db3 commit a2564f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/standard/mail.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ PHPAPI bool php_mail(const char *to, const char *subject, const char *message, c
438438
{
439439
FILE *sendmail;
440440
const char *sendmail_path = zend_ini_string_literal("sendmail_path");
441-
const char *sendmail_cmd = NULL;
441+
char *sendmail_cmd = NULL;
442442
const zend_string *mail_log = zend_ini_str_literal("mail.log");
443443
const char *hdr = headers;
444444
char *ahdr = NULL;
@@ -553,7 +553,7 @@ PHPAPI bool php_mail(const char *to, const char *subject, const char *message, c
553553
if (extra_cmd != NULL) {
554554
spprintf(&sendmail_cmd, 0, "%s %s", sendmail_path, ZSTR_VAL(extra_cmd));
555555
} else {
556-
sendmail_cmd = sendmail_path;
556+
sendmail_cmd = (char*)sendmail_path;
557557
}
558558

559559
#if PHP_SIGCHILD
@@ -576,7 +576,7 @@ PHPAPI bool php_mail(const char *to, const char *subject, const char *message, c
576576
sendmail = popen(sendmail_cmd, "w");
577577
#endif
578578
if (extra_cmd != NULL) {
579-
efree((char*)sendmail_cmd);
579+
efree(sendmail_cmd);
580580
}
581581

582582
if (sendmail) {

0 commit comments

Comments
 (0)