Skip to content

Conversation

@prvyk
Copy link
Contributor

@prvyk prvyk commented Aug 13, 2025

This PR contains two changes to avoid access to bytesRead, readHead or direct parsing during command parsing after the RespCommand is decided and parseState is set:

  1. ListReadKeysWithCount() in TxnKeyManager doesn't need to reparse the input. It has all required information already in respSession.parseState variable. We can then erase GetCommandAsArgSlice() as it's no longer necessary.

  2. MakeUpperCase() in RespServerSession used bytesRead - readHead for length. Which is wrong when called from GetOperationDirection(). There the actual length is only the argSlice length which is usually far smaller. This accidentally works for typical inputs (probably fails for crafted inputs), fix it by supplying the actual length.

(Both of these are from #1278, but are logically independent fixes we can push separately).

@prvyk prvyk force-pushed the parsingimprov branch 4 times, most recently from 566175f to a642573 Compare August 14, 2025 08:33
@TalZaccai TalZaccai self-requested a review August 14, 2025 18:12
Copy link
Contributor

@TalZaccai TalZaccai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great changes! Added one comment

@TalZaccai TalZaccai merged commit 04a949b into microsoft:main Aug 15, 2025
47 of 48 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants