Skip to content

fix(conf): cap proto-max-bulk-len to 4 GiB instead of UINT64_MAX #3419

Merged
git-hulk merged 4 commits intoapache:unstablefrom
songqing:fix/integer-overflow
Apr 5, 2026
Merged

fix(conf): cap proto-max-bulk-len to 4 GiB instead of UINT64_MAX #3419
git-hulk merged 4 commits intoapache:unstablefrom
songqing:fix/integer-overflow

Conversation

@songqing
Copy link
Copy Markdown
Contributor

@songqing songqing commented Apr 3, 2026

  • Cap 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
    4 GiB is chosen because:
    - RocksDB recommends keeping individual values under 3 GiB for
    performance and memory reasons.
    - It eliminates both the uint64_t overflow and the ssize_t cast hazard.
    - It is still far above any realistic bulk string size in practice.

@songqing songqing changed the title fix(server): fix integer overflows in bulk length parsing and PollUpdates fix(server): fix integer overflows in bulk length parsing Apr 3, 2026
@songqing songqing changed the title fix(server): fix integer overflows in bulk length parsing fix(conf): cap proto-max-bulk-len to 4 GiB instead of UINT64_MAX Apr 3, 2026
@git-hulk git-hulk requested review from PragmaTwice and jihuayu April 3, 2026 04:05
@git-hulk git-hulk enabled auto-merge (squash) April 5, 2026 06:39
@git-hulk git-hulk disabled auto-merge April 5, 2026 06:39
@git-hulk git-hulk enabled auto-merge (squash) April 5, 2026 06:39
@git-hulk git-hulk merged commit 784344e into apache:unstable Apr 5, 2026
36 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants