Skip to content

Commit f5afc2c

Browse files
committed
Fix potential mail related segfault on Windows
`rpath` may be `NULL` here, in which case we must not access its members.
1 parent 561b581 commit f5afc2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/imap/php_imap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3602,7 +3602,7 @@ bool _php_imap_mail(zend_string *to, zend_string *subject, zend_string *message,
36023602
}
36033603

36043604
if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, bufferHeader, ZSTR_VAL(subject),
3605-
bufferTo, ZSTR_VAL(message), bufferCc, bufferBcc, ZSTR_VAL(rpath)) != SUCCESS) {
3605+
bufferTo, ZSTR_VAL(message), bufferCc, bufferBcc, rpath ? ZSTR_VAL(rpath) : NULL) != SUCCESS) {
36063606
if (tsm_errmsg) {
36073607
php_error_docref(NULL, E_WARNING, "%s", tsm_errmsg);
36083608
efree(tsm_errmsg);

0 commit comments

Comments
 (0)