Unverified Commit 2ef829d6 authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo Committed by GitHub
Browse files

Merge pull request #5304 from soloestoy/fix-unexpected-readlen

networking: fix unexpected negative or zero readlen
parents e4298d11 dce7cefb
...@@ -1466,7 +1466,7 @@ void readQueryFromClient(aeEventLoop *el, int fd, void *privdata, int mask) { ...@@ -1466,7 +1466,7 @@ void readQueryFromClient(aeEventLoop *el, int fd, void *privdata, int mask) {
{ {
ssize_t remaining = (size_t)(c->bulklen+2)-sdslen(c->querybuf); ssize_t remaining = (size_t)(c->bulklen+2)-sdslen(c->querybuf);
if (remaining < readlen) readlen = remaining; if (remaining > 0 && remaining < readlen) readlen = remaining;
} }
qblen = sdslen(c->querybuf); qblen = sdslen(c->querybuf);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment