You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: libobs: obs_reset_audio2 and obs_get_audio_info2 read through a null core (UBSan) #3363
The asan pass (ASan + UBSan) reports undefined behaviour in two tests:
libobs/obs.c.h:1624:25: runtime error: member access within null pointer of type 'struct obs_core'
#0 obs_reset_audio2 libobs/obs.c.h:1624
#1 test_before_startup test/cmocka/test_core_setup_rules_steps.c:323
libobs/obs.c.h:1747:25: runtime error: member access within null pointer of type 'struct obs_core'
#0 obs_get_audio_info2 libobs/obs.c.h:1747
#1 test_audio_info2_no_core test/cmocka/test_no_core_getters.c:106
Both functions start with struct obs_core_audio *audio = &obs->audio; before they check for a core. With obs == NULL the address computation is already undefined behaviour, even when the function returns before it reads audio. It works in practice, but UBSan reports it every run.
What to do
Check obs (or call the existing no-core check) before taking &obs->audio. The tests already cover the no-core path. Only trusted local callers reach it, so this is a normal public bug.
The sanitizer harness's known list (rust/tools/sanitize/triage.py, #3290) has this as kind bug: the asan job does not count it, but fails once the test runs clean. So the fix PR also drops the entry.
RED: the asan pass reports both UBSan findings (test_core_setup_rules_steps, test_no_core_getters); no new test needed.
GREEN: obs_reset_audio2 and obs_get_audio_info2 return before they take &obs->audio when there is no core; the same for the Rust side if it mirrors it.
Activity
vpacher commentedon Nov 1, 2026
/ready
vpacher commentedon Nov 1, 2026
Claiming: check the core before
&obs->audioPlan (one PR, after #3290):
test_core_setup_rules_steps,test_no_core_getters); no new test needed.obs_reset_audio2andobs_get_audio_info2return before they take&obs->audiowhen there is no core; the same for the Rust side if it mirrors it.bugentries from the known list.First PR: after #3290 merges.
vpacher commentedon Nov 1, 2026
Blocked: waiting on #3290
fix(libobs): check the core before taking &obs->audio (obs-rust#3363) (…