Skip to content

Commit

Permalink
make sure we bail a request that has no CRLF
Browse files Browse the repository at this point in the history
  • Loading branch information
tarekziade committed Dec 17, 2012
1 parent 8178424 commit 3fb3cd3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vaurien/protocols/redis.py
Expand Up @@ -22,7 +22,7 @@ def _find(self, source, buffer, char, dest):
while pos == -1:
data = self._get_data(source)
if data == '':
return -1
return -1, buffer
dest.sendall(data)
buffer += data
pos = buffer.find(char)
Expand All @@ -33,6 +33,9 @@ def _handle(self, source, dest, to_backend):
"""
# grabbing data
bytepos, buffer = self._find(source, '', CRLF, dest)
if bytepos == -1:
return False

num_args = int(buffer[1:bytepos])

for arg in range(num_args):
Expand Down

0 comments on commit 3fb3cd3

Please sign in to comment.