Skip to content
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

fix parse eval on SW_ARG2 caclulate r->rlen error #654

Merged
merged 4 commits into from
Sep 26, 2021

Conversation

kukey
Copy link
Contributor

@kukey kukey commented Sep 25, 2021

Problem

This bug is very hidden and must be reproduced using carefully constructed commands.
The key point is:

  • the command is eval
  • first enter parse SW_ARG2 (m = p + r->rlen) >= b->last

eg(mbuf is 512):
eval "return                                                                                                                                                                                                                                                                                                                                                                                                           {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}   " 2 key1 first
截图_选择区域_20210925230201

Solution
When m > b->last will due to repair mbuf, so only r->token == NULL, need caculate r->rlen again.

Result
截图_选择区域_20210925230303

src/proto/nc_redis.c Outdated Show resolved Hide resolved
@TysonAndre TysonAndre merged commit c3f433b into twitter:master Sep 26, 2021
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