summaryrefslogtreecommitdiff
path: root/redis/connection.py
diff options
context:
space:
mode:
Diffstat (limited to 'redis/connection.py')
-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):