Skip to content

Commit 77e8aae

Browse files
committed
Fix panic during protocol decode
1 parent cd8baa2 commit 77e8aae

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes
22

3+
## [0.2.3] - 2021-09-03
4+
5+
* Fix panic during protocol decoding
6+
37
## [0.2.2] - 2021-08-28
48

59
* use new ntex's timer api

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ntex-redis"
3-
version = "0.2.2"
3+
version = "0.2.3"
44
authors = ["ntex contributors <[email protected]>"]
55
description = "Redis client"
66
documentation = "https://docs.rs/ntex-redis"
@@ -21,7 +21,7 @@ openssl = ["ntex/openssl"]
2121
rustls = ["ntex/rustls"]
2222

2323
[dependencies]
24-
ntex = "0.4.0-b.4"
24+
ntex = "0.4.0-b.11"
2525
itoa = "0.4.5"
2626
btoi = "0.4.2"
2727
log = "0.4"

src/codec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ fn write_string(symb: u8, string: &str, buf: &mut BytesMut) {
552552
type DecodeResult = Result<Option<(usize, Response)>, Error>;
553553

554554
fn decode(buf: &mut BytesMut, idx: usize) -> DecodeResult {
555-
if !buf.is_empty() {
555+
if buf.len() > idx {
556556
match buf[idx] {
557557
b'$' => decode_bytes(buf, idx + 1),
558558
b'*' => decode_array(buf, idx + 1),

0 commit comments

Comments
 (0)