Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sapi/fpm/fpm/fpm_php.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ static int fpm_php_zend_ini_alter_master(char *name, int name_length, char *new_
ini_entry->modifiable = mode;
}
} else {
/* The string wasn't installed and won't be shared, it's safe to drop. */
GC_MAKE_PERSISTENT_LOCAL(duplicate);
zend_string_release_ex(duplicate, 1);
Comment on lines +44 to 46
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, zend_string_free() might be a little more explicit in that “this is expected to be RC 1 at this point”?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd honestly prefer not to change behavior for the patch. Should be ok for master.

}

Expand Down
48 changes: 48 additions & 0 deletions sapi/fpm/tests/php_admin_value-failure.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
--TEST--
RC violation on failed php_admin_value
--SKIPIF--
<?php include "skipif.inc"; ?>
--FILE--
<?php

require_once "tester.inc";

$cfg = <<<EOT
[global]
error_log = {{FILE:LOG}}
[unconfined]
listen = {{ADDR}}
pm = dynamic
pm.max_children = 5
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 3
php_admin_value[precision]=-2
EOT;

$code = <<<EOT
<?php
var_dump(ini_get('precision'));
EOT;

$ini = <<<EOT
precision=14
EOT;

$tester = new FPM\Tester($cfg, $code);
$tester->setUserIni($ini);
$tester->start();
$tester->expectLogStartNotices();
$tester->request()->expectBody(['string(2) "14"']);
$tester->terminate();
$tester->close();

?>
Done
--EXPECT--
Done
--CLEAN--
<?php
require_once "tester.inc";
FPM\Tester::clean();
?>
Loading