Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PaPulseAudio_Initialize does not unlock correctly on error path #848

Closed
RossBencina opened this issue Oct 6, 2023 · 1 comment · Fixed by #852
Closed

PaPulseAudio_Initialize does not unlock correctly on error path #848

RossBencina opened this issue Oct 6, 2023 · 1 comment · Fixed by #852
Assignees
Labels
P1 Priority: Highest src-pulseaudio PulseAudio Host API in src/hostapi/pulseaudio

Comments

@RossBencina
Copy link
Collaborator

This PR fixes an access-after free when calling PaPulseAudio_UnLock

#847

However the bigger issue is that PaPulseAudio_UnLock is not called consistently. Either PaPulseAudio_UnLock needs to be called before or after goto error but not both or neither. On line 563 it gets locked, but there is also a goto error prior to that on line 550. Some later goto error paths unlock, some don't.

One possible fix is to have an error_unlock: label prior to the error label that is used for paths that should unlock.

@RossBencina
Copy link
Collaborator Author

@illuusio assigning this to you

@RossBencina RossBencina added the P1 Priority: Highest label Dec 15, 2023
philburk pushed a commit that referenced this issue Dec 22, 2023
Make sure that if PaPulseAudio_Initialize fails that
a) Mainloop is unlocked if HostAPI is initialized
b) Unlocking is done before freeing
c) It's done only once

Also move allocations group freeing code to correct place
now there only one place where it's called.

Fixes #848
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Priority: Highest src-pulseaudio PulseAudio Host API in src/hostapi/pulseaudio
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants