Skip to content

fix: fallthrough bug in transformDoubleReply#3213

Open
rhymincymon wants to merge 1 commit intoredis:masterfrom
rhymincymon:fix-fallthrough-bug
Open

fix: fallthrough bug in transformDoubleReply#3213
rhymincymon wants to merge 1 commit intoredis:masterfrom
rhymincymon:fix-fallthrough-bug

Conversation

@rhymincymon
Copy link
Copy Markdown

@rhymincymon rhymincymon commented Mar 29, 2026

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
Copy link
Copy Markdown

jit-ci bot commented Mar 29, 2026

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.

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.

1 participant