Unverified Commit da840e98 authored by zhaozhao.zz's avatar zhaozhao.zz Committed by GitHub
Browse files

more strict check in rioConnRead (#7564)

parent 8a57969f
......@@ -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;
......
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