Unverified Commit db6655de authored by sundb's avatar sundb Committed by GitHub
Browse files

Fix crash when hz config out of range (#8658)

Fix crash when hz config out of range
parent cf0a909e
...@@ -621,6 +621,10 @@ void loadServerConfigFromString(char *config) { ...@@ -621,6 +621,10 @@ void loadServerConfigFromString(char *config) {
goto loaderr; goto loaderr;
} }
/* To ensure backward compatibility and work while hz is out of range */
if (server.config_hz < CONFIG_MIN_HZ) server.config_hz = CONFIG_MIN_HZ;
if (server.config_hz > CONFIG_MAX_HZ) server.config_hz = CONFIG_MAX_HZ;
sdsfreesplitres(lines,totlines); sdsfreesplitres(lines,totlines);
return; return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment