This is an automated email from the ASF dual-hosted git repository.
hulk pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git
The following commit(s) were added to refs/heads/unstable by this push:
new 784344e3c fix(conf): cap proto-max-bulk-len to 4 GiB instead of
UINT64_MAX (#3419)
784344e3c is described below
commit 784344e3c34db8d9df2065f42f998af46dae8d09
Author: Songqing Zhang <[email protected]>
AuthorDate: Sun Apr 5 15:46:57 2026 +0800
fix(conf): cap proto-max-bulk-len to 4 GiB instead of UINT64_MAX (#3419)
Change proto_max_bulk_len to 4G so that bulk_len_+2 used for
CRLF accounting in RESP parsing can never wrap around, see` if
(evbuffer_get_length(input) < bulk_len_ + 2) return Status::OK();` in
[code](https://github.com/apache/kvrocks/blob/da5e46307047b3e89753f0c9c02996430e758a5f/src/server/redis_request.cc#L123).
---------
Co-authored-by: hulk <[email protected]>
---
src/config/config.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/config/config.cc b/src/config/config.cc
index 55dada9cf..5abfa2bd0 100644
--- a/src/config/config.cc
+++ b/src/config/config.cc
@@ -239,7 +239,7 @@ Config::Config() {
{"resp3-enabled", false, new YesNoField(&resp3_enabled, true)},
{"repl-namespace-enabled", false, new
YesNoField(&repl_namespace_enabled, false)},
{"proto-max-bulk-len", false,
- new IntWithUnitField<uint64_t>(&proto_max_bulk_len, std::to_string(512
* MiB), 1 * MiB, UINT64_MAX)},
+ new IntWithUnitField<uint64_t>(&proto_max_bulk_len, std::to_string(512
* MiB), 1 * MiB, 4ULL * 1024 * 1024 * 1024)},
{"json-max-nesting-depth", false, new IntField(&json_max_nesting_depth,
1024, 0, INT_MAX)},
{"json-storage-format", false,
new EnumField<JsonStorageFormat>(&json_storage_format,
json_storage_formats, JsonStorageFormat::JSON)},