Skip to content

修复解析redis响应中 *-1\r\n 的问题#506

Open
hustfisher wants to merge 2 commits intomainfrom
fix_rsp_parse_bug_0829
Open

修复解析redis响应中 *-1\r\n 的问题#506
hustfisher wants to merge 2 commits intomainfrom
fix_rsp_parse_bug_0829

Conversation

@hustfisher
Copy link
Copy Markdown
Member

breeze 解析redis响应时,没有处理 “*-1\r\n”,可能出现不可预知的问题:

  1. 在 debug 模式下,Rust 会直接触发 panic(运行时错误),提示整数溢出,导致连接断开。
  2. 在 release 模式下(默认关闭溢出检查),会按照无符号整数的环绕规则处理,结果为 usize::MAX - 2(例如 64 位系统上是 18446744073709551613),pipeline下会吞噬并读取到非法位置。

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.

1 participant