Avoid heap buffer overflow in valkeyAsyncFormattedCommand#245
Avoid heap buffer overflow in valkeyAsyncFormattedCommand#245bjosv merged 7 commits intovalkey-io:mainfrom
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 <bjorn.a.svensson@est.tech>
Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
|
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 <bjorn.a.svensson@est.tech>
Co-authored-by: michael-grunder <michael.grunder@gmail.com> Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
|
I incorporated your length parser now so the PR got a bit bigger, but I think its more straight on. |
|
It seems that |
valkeyAsyncFormattedCommandnow returnsVALKEY_ERRinstead 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
nextArgumentfunction now takes a new function argument, the buffer length, to be able to do the validation.Fixes #242