Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
3e4e6f7c
Commit
3e4e6f7c
authored
Jun 21, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/nfs: never read more than space available in buffer
Avoids off-by-one bug and obsoletes the bug fix in commit
966c4244
parent
936eb43c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
NfsInputPlugin.cxx
src/input/plugins/NfsInputPlugin.cxx
+4
-2
No files found.
src/input/plugins/NfsInputPlugin.cxx
View file @
3e4e6f7c
...
@@ -93,12 +93,14 @@ NfsInputStream::DoRead()
...
@@ -93,12 +93,14 @@ NfsInputStream::DoRead()
if
(
remaining
<=
0
)
if
(
remaining
<=
0
)
return
true
;
return
true
;
if
(
IsBufferFull
())
{
const
size_t
buffer_space
=
GetBufferSpace
();
if
(
buffer_space
==
0
)
{
Pause
();
Pause
();
return
true
;
return
true
;
}
}
size_t
nbytes
=
std
::
min
<
uint64_t
>
(
remaining
,
32768
);
size_t
nbytes
=
std
::
min
<
size_t
>
(
std
::
min
<
uint64_t
>
(
remaining
,
32768
),
buffer_space
);
mutex
.
unlock
();
mutex
.
unlock
();
Error
error
;
Error
error
;
...
...
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