event/BufferedSocket: OnSocketReady() returns true after close
Fixes use-after-free bug (https://bugs.musicpd.org/view.php?id=4548).
This commit is contained in:
parent
6f59d71e07
commit
b46cf57d98
1
NEWS
1
NEWS
@ -5,6 +5,7 @@ ver 0.19.17 (not yet released)
|
||||
* fix spurious seek error "Failed to allocate silence buffer"
|
||||
* replay gain: fix "replay_gain_handler mixer" setting
|
||||
* DSD: use 0x69 as silence pattern
|
||||
* fix use-after-free bug on "close"
|
||||
|
||||
ver 0.19.16 (2016/06/13)
|
||||
* faster seeking
|
||||
|
@ -118,9 +118,15 @@ BufferedSocket::OnSocketReady(unsigned flags)
|
||||
if (flags & READ) {
|
||||
assert(!input.IsFull());
|
||||
|
||||
if (!ReadToBuffer() || !ResumeInput())
|
||||
if (!ReadToBuffer())
|
||||
return false;
|
||||
|
||||
if (!ResumeInput())
|
||||
/* we must return "true" here or
|
||||
SocketMonitor::Dispatch() will call
|
||||
Cancel() on a freed object */
|
||||
return true;
|
||||
|
||||
if (!input.IsFull())
|
||||
ScheduleRead();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user