mirror of
https://github.com/redis/redis.git
synced 2026-04-21 03:01:35 -04:00
Fix crash when hz config out of range (#8658)
Fix crash when hz config out of range
This commit is contained in:
@@ -621,6 +621,10 @@ void loadServerConfigFromString(char *config) {
|
||||
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);
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user