Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix undefined behaviour in get_num_outputs in CoreAudio driver (#594)
See discussion in #591 for details. Basically an incorrect size was being allocated for the CoreAudio buffer list for a device. It was being allocated by a VLA (which already did not quite fit the semantics of the list) and the length calculated could be 0 (instead of the size of the struct with no buffers elements) causing undefined behaviour. This corrects it to allocate the amount of memory required by the CoreAudio framework function and adds a check for the size retrieval and for the dynamic allocation. This change passed UBSan in my test where before the change it did not. Fixes #591
- Loading branch information