Skip to content

Commit 5c19806

Browse files
committed
Ensure that mail.force_extra_parameters INI directive does not have any nul bytes
1 parent 7ad5999 commit 5c19806

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,11 @@ static PHP_INI_MH(OnUpdateMailLog)
652652
/* {{{ PHP_INI_MH */
653653
static PHP_INI_MH(OnChangeMailForceExtra)
654654
{
655+
/* Check that INI setting does not have any nul bytes */
656+
if (new_value && ZSTR_LEN(new_value) != strlen(ZSTR_VAL(new_value))) {
657+
/* TODO Emit warning? */
658+
return FAILURE;
659+
}
655660
/* Don't allow changing it in htaccess */
656661
if (stage == PHP_INI_STAGE_HTACCESS) {
657662
return FAILURE;

0 commit comments

Comments
 (0)