Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
da840e98
Unverified
Commit
da840e98
authored
Jul 24, 2020
by
zhaozhao.zz
Committed by
GitHub
Jul 24, 2020
Browse files
more strict check in rioConnRead (#7564)
parent
8a57969f
Changes
1
Show whitespace changes
Inline
Side-by-side
src/rio.c
View file @
da840e98
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment