mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-04 16:37:20 +02:00
Avoid crash in "postgres -C guc" for a GUC with a null string value.
Emit "(null)" instead, which was the behavior all along on platforms that don't crash, eg OS X. Per report from Jehan-Guillaume de Rorthais. Back-patch to 9.2 where -C option was introduced. Michael Paquier Report: <20160615204036.2d35d86a@firost>
This commit is contained in:
parent
455812da48
commit
4f5995dd98
@ -821,10 +821,14 @@ PostmasterMain(int argc, char *argv[])
|
|||||||
if (output_config_variable != NULL)
|
if (output_config_variable != NULL)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* permission is handled because the user is reading inside the data
|
* "-C guc" was specified, so print GUC's value and exit. No extra
|
||||||
* dir
|
* permission check is needed because the user is reading inside the
|
||||||
|
* data dir.
|
||||||
*/
|
*/
|
||||||
puts(GetConfigOption(output_config_variable, false, false));
|
const char *config_val = GetConfigOption(output_config_variable,
|
||||||
|
false, false);
|
||||||
|
|
||||||
|
puts(config_val ? config_val : "(null)");
|
||||||
ExitPostmaster(0);
|
ExitPostmaster(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user