Browse Source

Fix a crash in JackPosixSemaphore::Wait()

Crash was observed in this function when fSemaphore was NULL, this patch
copies the NULL pointer check from the commented function above into
Wait()
tags/v1.9.11-RC1
James Thomas 8 years ago
parent
commit
d9918c3d29
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      posix/JackPosixSemaphore.cpp

+ 5
- 0
posix/JackPosixSemaphore.cpp View File

@@ -102,6 +102,11 @@ bool JackPosixSemaphore::Wait()
{
int res;

if (!fSemaphore) {
jack_error("JackPosixSemaphore::Wait name = %s already deallocated!!", fName);
return false;
}

while ((res = sem_wait(fSemaphore) < 0)) {
jack_error("JackPosixSemaphore::Wait name = %s err = %s", fName, strerror(errno));
if (errno != EINTR) {


Loading…
Cancel
Save