summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Owen <josh@openfolio.com>2014-08-13 17:54:31 -0400
committerJosh Owen <josh@openfolio.com>2014-08-13 17:54:31 -0400
commitb3ad1d5dbb6d1ae3b3acdad0bd532772714054a6 (patch)
tree2add62dc99ad86be1fdc942b38042777f73a470c
parenteb51763707a85ca1a0aebea502ecfdefe1aa5ad2 (diff)
downloadredis-py-b3ad1d5dbb6d1ae3b3acdad0bd532772714054a6.tar.gz
handle buffer edgecase
-rwxr-xr-xredis/connection.py2
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):