Skip to content

file.c: Increment the channel reference count when it is added as owner to a ast_filestream #1213

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Josh-Hogan
Copy link

SEGFAULTS and memory corruption has been reported at locations where the ast_filestream->owner is assumed to point to a vaild channel, sometimes it does not (and appears to have been freed).

Fixes: #829

UserNote: Ensure we increment the channel reference count when it is added as the owner of a ast_filestream and decrement it when the ast_filestream is destroyed

…er to a ast_filestream

SEGFAULTS and memory corruption has been reported at locations where the ast_filestream->owner is assumed to point to a vaild channel, sometimes it does not (and appears to have been freed).

Fixes: asterisk#829

UserNote: Ensure we increment the channel reference count when it is added as the owner of a ast_filestream and decrement it when the ast_filestream is destroyed
@Josh-Hogan
Copy link
Author

cherry-pick-to: 20
cherry-pick-to: 21
cherry-pick-to: 22

@Josh-Hogan
Copy link
Author

@duncannz Let me know how you get on testing this. You might need to cherry pick the changes onto the Asterisk version you are using - example I have done for 20.9.3 https://github.com/asterisk/asterisk/compare/20.9.3...Josh-Hogan:20.9.3-with-josh-patch.diff

If it works I can undraft this PR.
If it doesn't work - happy to make more changes if you have more core-dumps.

Copy link

Workflow PRCheck completed successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: Segmentation fault - Failed assertion bad magic number 0x0 for object, when using a file MOH generator
1 participant