Prevent MPD crash

Discuss client development (or even MPD development if you feel so inclined), ask questions about the client libs, MPD feature requests from client developers, etc...
Post Reply
oispkc
Posts: 5
Joined: November 16th, 2014, 12:43 am

Prevent MPD crash

Post by oispkc »

In SocketMonitor.cxx source file

void
SocketMonitor::Dispatch(unsigned flags)
{
flags &= GetScheduledFlags();

if (flags != 0 && !OnSocketReady(flags) && IsDefined())
Cancel();
}

This function should be modified like below because sometimes segmentation fault occurs in this function
especially when using named pipe output.

void
SocketMonitor::Dispatch(unsigned flags)
{
flags &= GetScheduledFlags();

if (flags == 0) return;
if (!IsDefined()) return;
if (!OnSocketReady(flags))
Cancel();
}

Am I right?

max
Forum team
Posts: 1024
Joined: January 15th, 2013, 3:43 pm

Re: Prevent MPD crash

Post by max »

No idea. You did not provide any information about what this tries to solve, and you did not explain why you want this change.

Post Reply