Repository navigation
mod-audio-fork: robustness fixes (lifetime, races, input validation, tests) - #3
Draft
pragmatrix wants to merge 36 commits into
Draft
pragmatrix wants to merge 36 commits into
pragmatrix wants to merge 36 commits into
Conversation
… resample overflow, null logs Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…p playAudio and transcription Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…y start failures Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… drop unused private_t fields Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…yed back Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…to the frame Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…clangd and IntelliSense config Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…utdown read the pipe handle Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… reading a NULL argv Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… issue Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…callers, check read_impl status Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
pragmatrix
marked this pull request as draft
October 8, 2026 19:06
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…watch, note the receive buffer and event subclass findings Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
mod_audio_fork had several crash and memory-safety problems: use-after-free of the AudioPipe, races between the lws thread and session cleanup, unchecked inputs on the API (missing arguments, unbounded sample rates, long URIs), NULL dereferences, and C++ exceptions that could terminate FreeSWITCH. Some behaviour was also unsafe by default (bidirectional audio enabled implicitly, unbounded inbound binary).
Summary
startneeds the sample rate argument (previously a NULL strcmp crash); sample rates are limited to 64000; host/path are length-checked and strings terminated; the read codec is checked after pre-answer.just ide-setup.playAudioandtranscriptionmessages and events.issues/review-findings.mdrecords the review status: what is fixed, what was checked and found not to be an issue, and what is still open.Behaviour changes
bidirectional_audio_enablenow defaults to 0 for the short start syntax; callers that relied on it being on must pass it explicitly.playAudioandtranscriptiontext frames and theirplay_audio/transcriptionevents are gone. Servers sending them now hit the unknown-type branch.startrejects sample rates above 64000 and a missing sample rate.Validation
just test(compile against FreeSWITCH 1.11.3 / libwebsockets 5.0.0 headers in Docker, plus unit tests): passes, including the new saturating-add tests.Still open (see issues/review-findings.md): module unload with calls in progress does not close live pipes; first text fragment size is not bounded by the receive limit;
findAndRemovePendingConnectcan drop pipes that have not started connecting.Note
This was created entirely with AI assistance.