Skip to content

fix: fallthrough bug in transformDoubleReply - #3213

Merged
nkaradzhov merged 1 commit into
redis:masterfrom
rhymincymon:fix-fallthrough-bug
Mar 30, 2026
Merged

nkaradzhov merged 1 commit into
redis:masterfrom
rhymincymon:fix-fallthrough-bug

Conversation

@rhymincymon

@rhymincymon rhymincymon commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

The inner switch in transformDoubleReply is missing break statements, causing every case to fall through to default and overwrite ret with Number(reply). This means '+inf' and '-inf' replies are never correctly converted to Infinity and -Infinity.


Note

Medium Risk
Touches shared reply-parsing logic used across many commands; while the change is small, it alters how special double strings are converted and could affect downstream consumers that relied on the previous (buggy) behavior.

Overview
Fixes transformDoubleReply so RESP2 double string replies for +inf/-inf/nan no longer fall through to the default numeric conversion.

Adds missing break statements in the inner switch, ensuring Infinity, -Infinity, and NaN are preserved instead of being overwritten by Number(reply).

Written by Cursor Bugbot for commit d4e4d92. This will update automatically on new commits. Configure here.

@jit-ci

jit-ci Bot commented Mar 29, 2026

Copy link
Copy Markdown

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@nkaradzhov

Copy link
Copy Markdown
Collaborator

@rhymincymon thanks for catching this! I will take a look

@nkaradzhov
nkaradzhov merged commit 2e167bb into redis:master Mar 30, 2026
16 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