Skip to content

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

Merged
TysonAndre merged 4 commits into
twitter:masterfrom
kukey:fix-eval-bug
Sep 26, 2021
Merged

fix parse eval on SW_ARG2 caclulate r->rlen error#654
TysonAndre merged 4 commits into
twitter:masterfrom
kukey:fix-eval-bug

Conversation

@kukey

@kukey kukey commented Sep 25, 2021

Copy link
Copy Markdown
Contributor

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

Comment thread src/proto/nc_redis.c Outdated
kukey and others added 3 commits September 26, 2021 14:34
Co-authored-by: Tyson Andre <tyson.andre@uwaterloo.ca>
@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