mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
fix short period of server.hz being uninitialized
server.hz was uninitialized between initServerConfig and initServer. this can lead to someone (e.g. queued modules) doing createObject, and accessing an uninitialized variable, that can potentially be 0, and lead to a crash.
This commit is contained in:
parent
d790e2db2e
commit
eae8d05826
@ -1529,7 +1529,7 @@ void initServerConfig(void) {
|
|||||||
server.timezone = getTimeZone(); /* Initialized by tzset(). */
|
server.timezone = getTimeZone(); /* Initialized by tzset(). */
|
||||||
server.configfile = NULL;
|
server.configfile = NULL;
|
||||||
server.executable = NULL;
|
server.executable = NULL;
|
||||||
server.config_hz = CONFIG_DEFAULT_HZ;
|
server.hz = server.config_hz = CONFIG_DEFAULT_HZ;
|
||||||
server.dynamic_hz = CONFIG_DEFAULT_DYNAMIC_HZ;
|
server.dynamic_hz = CONFIG_DEFAULT_DYNAMIC_HZ;
|
||||||
server.arch_bits = (sizeof(long) == 8) ? 64 : 32;
|
server.arch_bits = (sizeof(long) == 8) ? 64 : 32;
|
||||||
server.port = CONFIG_DEFAULT_SERVER_PORT;
|
server.port = CONFIG_DEFAULT_SERVER_PORT;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user