From 3acfaa75ca3fc60c41ac11fd34b48f94dc5b2de5 Mon Sep 17 00:00:00 2001 From: Brennan Cathcart Date: Tue, 2 Jul 2024 19:28:20 +0000 Subject: [PATCH] Fix ULong config boundary checking Signed-off-by: Brennan Cathcart --- src/cluster_legacy.c | 2 +- src/config.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cluster_legacy.c b/src/cluster_legacy.c index b37c436bcd..82afea0ba8 100644 --- a/src/cluster_legacy.c +++ b/src/cluster_legacy.c @@ -1849,7 +1849,7 @@ void clusterHandleConfigEpochCollision(clusterNode *sender) { * that even if we receive gossip messages from other nodes that still remember * about the node we want to remove, we don't re-add it before some time. * - * The default blacklist ttl is set to 1 minute which means + * The default blacklist ttl is 1 minute which means * that valkey-cli has 60 seconds to send CLUSTER FORGET messages to nodes * in the cluster without dealing with the problem of other nodes re-adding * back the node to nodes we already sent the FORGET command to. diff --git a/src/config.c b/src/config.c index ea733c099b..3beb066c80 100644 --- a/src/config.c +++ b/src/config.c @@ -3208,9 +3208,9 @@ standardConfig static_configs[] = { #endif /* Unsigned Long configs */ - createULongConfig("active-defrag-max-scan-fields", NULL, MODIFIABLE_CONFIG, 1, LONG_MAX, server.active_defrag_max_scan_fields, 1000, INTEGER_CONFIG, NULL, NULL), /* Default: keys with more than 1000 fields will be processed separately */ - createULongConfig("slowlog-max-len", NULL, MODIFIABLE_CONFIG, 0, LONG_MAX, server.slowlog_max_len, 128, INTEGER_CONFIG, NULL, NULL), - createULongConfig("acllog-max-len", NULL, MODIFIABLE_CONFIG, 0, LONG_MAX, server.acllog_max_len, 128, INTEGER_CONFIG, NULL, NULL), + createULongConfig("active-defrag-max-scan-fields", NULL, MODIFIABLE_CONFIG, 1, ULONG_MAX, server.active_defrag_max_scan_fields, 1000, INTEGER_CONFIG, NULL, NULL), /* Default: keys with more than 1000 fields will be processed separately */ + createULongConfig("slowlog-max-len", NULL, MODIFIABLE_CONFIG, 0, ULONG_MAX, server.slowlog_max_len, 128, INTEGER_CONFIG, NULL, NULL), + createULongConfig("acllog-max-len", NULL, MODIFIABLE_CONFIG, 0, ULONG_MAX, server.acllog_max_len, 128, INTEGER_CONFIG, NULL, NULL), createULongConfig("cluster-blacklist-ttl", NULL, MODIFIABLE_CONFIG, 0, ULONG_MAX, server.cluster_blacklist_ttl, 60, INTEGER_CONFIG, NULL, NULL), /* Long Long configs */