diff options
author | Josh Owen <josh@openfolio.com> | 2014-08-13 17:54:31 -0400 |
---|---|---|
committer | Josh Owen <josh@openfolio.com> | 2014-08-13 17:54:31 -0400 |
commit | b3ad1d5dbb6d1ae3b3acdad0bd532772714054a6 (patch) | |
tree | 2add62dc99ad86be1fdc942b38042777f73a470c | |
parent | eb51763707a85ca1a0aebea502ecfdefe1aa5ad2 (diff) | |
download | redis-py-b3ad1d5dbb6d1ae3b3acdad0bd532772714054a6.tar.gz |
handle buffer edgecase
-rwxr-xr-x | redis/connection.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/redis/connection.py b/redis/connection.py index 2d666fb..4c8b681 100755 --- a/redis/connection.py +++ b/redis/connection.py @@ -348,7 +348,7 @@ class HiredisParser(BaseParser): # proactively, but not conclusively, check if more data is in the # buffer. if the data received doesn't end with \r\n, there's more. if HIREDIS_USE_BYTE_BUFFER: - if self._buffer[bufflen - 2:bufflen] != SYM_CRLF: + if bufflen > 2 and self._buffer[bufflen - 2:bufflen] != SYM_CRLF: continue else: if not buffer.endswith(SYM_CRLF): |