-
Notifications
You must be signed in to change notification settings - Fork 17
Avoid heap buffer overflow in valkeyAsyncFormattedCommand #245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
valkeyAsyncFormattedCommand returns VALKEY_ERR instead of asserting when the command length, or content, is faulty. Validate parsed length and make sure we don't read past the buffer end. Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
This is great. The only big questions I have are around bulk length (e.g. If we are only ever going to accept I played around with something like that here: That might be overkill though 😄 |
Signed-off-by: Björn Svensson <[email protected]>
Co-authored-by: michael-grunder <[email protected]> Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
I incorporated your length parser now so the PR got a bit bigger, but I think its more straight on. |
valkeyAsyncFormattedCommand
now returnsVALKEY_ERR
instead of crashing when the command length, or content, is faulty.Adds validation of the parsed length to make sure we don't read past the buffer end.
The internal
nextArgument
function now takes a new function argument, the buffer length, to be able to do the validation.Fixes #242