summaryrefslogtreecommitdiff
path: root/src/rio.c
diff options
context:
space:
mode:
authorzhaozhao.zz <276441700@qq.com>2020-07-24 14:40:19 +0800
committerGitHub <noreply@github.com>2020-07-24 14:40:19 +0800
commitda840e9851bab8d1674e245a812b2105be111208 (patch)
treee4884bea6cda7978c3d145b9a3387826bcb6ef8c /src/rio.c
parent8a57969fd75db01b881d438200911d95bdead293 (diff)
downloadredis-da840e9851bab8d1674e245a812b2105be111208.tar.gz
more strict check in rioConnRead (#7564)
Diffstat (limited to 'src/rio.c')
-rw-r--r--src/rio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rio.c b/src/rio.c
index 77ba69fdc..bbef81b68 100644
--- a/src/rio.c
+++ b/src/rio.c
@@ -201,7 +201,7 @@ static size_t rioConnRead(rio *r, void *buf, size_t len) {
/* Make sure the caller didn't request to read past the limit.
* If they didn't we'll buffer till the limit, if they did, we'll
* return an error. */
- if (r->io.conn.read_limit >= r->io.conn.read_so_far + needs)
+ if (r->io.conn.read_limit >= r->io.conn.read_so_far + len)
toread = r->io.conn.read_limit - r->io.conn.read_so_far - buffered;
else {
errno = EOVERFLOW;