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
libobs: A refused registration can call a partly copied free_type_data pointer #2195
HANDLE_ERROR in libobs/obs-module.c.h can call a partly copied function pointer. It runs when obs_register_source_s, obs_register_output_s, obs_register_encoder_s or obs_register_service_s refuses a registration:
err_data starts zeroed and receives the first size_var bytes of the caller's struct. If size_var ends partway through free_type_data (or type_data), the pointer holds only some of the caller's bytes, and the code calls it. The move harness in #2194 crashed this way for a service registered with size 137: it jumped to 0x80.
This can only happen when a plugin passes a size that isn't its struct's sizeof(). The bundled plugins and the public obs_register_*() macros always pass sizeof. Upstream has the same code.
Plan
RED: a cmocka test that registers each type with a refused info struct whose size ends inside type_data, inside free_type_data, and just after both. Check that free_type_data is called only when both fields lie wholly within size, and that nothing crashes.
GREEN: in HANDLE_ERROR, read type_data and free_type_data only when offsetof + sizeof <= size, as HAS_VAL already does. Every registration that passes sizeof behaves exactly as before.
Activity
rdoupe commentedon Oct 24, 2026
Claiming: #2195.
libobs: Free a refused type's data only when its fields are whole (ob…