Repository navigation
Description
obs_is_output_protocol_registered(NULL) crashes OBS in strcmp(), and so does obs_enum_output_types_with_protocol(NULL, ...), which asks it first. obs_enum_output_protocols(idx, NULL) writes through the NULL out pointer. A NULL protocol is not a registered protocol, so the check should return false and the enumeration should call nothing.
Upstream (obsproject/obs-studio master) has the same code. I found no upstream issue or PR for it.
Location
libobs/obs.c.hobs_is_output_protocol_registered()(3558-3566):strcmp(protocol, obs->data.protocols.array[i])with no NULL check. It crashes as soon as any service output has registered a protocol, whichobs-outputs(RTMP, RTMPS),obs-ffmpeg(SRT, RIST, HLS) andobs-webrtc(WHIP) always do.libobs/obs-output.c.hobs_enum_output_types_with_protocol()(2762): callsobs_is_output_protocol_registered(protocol)first, so it crashes the same way.libobs/obs.c.hobs_enum_output_protocols()(3568-3575):*protocol = ...with no check of the out pointer.frontend/wizards/AutoConfigTestPage.cpp.hpp(220-233): the auto-configuration wizard passesobs_service_get_protocol(service)unchecked tocan_use_output()(frontend/utility/BasicOutputHandler.hpp149), which runsstrcmp()on it, and then toobs_enum_output_types_with_protocol().GetStreamOutputType()(BasicOutputHandler.cpp.hpp170-176), the path that starts a real stream, already checks for NULL and logs "has no protocol set".
Class
Crash (NULL dereference, SIGSEGV) through the public API.
How it is reached
obs_service_get_protocol() returns NULL for a NULL service (obs_service_valid() fails), and a third-party service plugin can return NULL from get_protocol (registration only checks that the callback exists). Whatever then passes that protocol on crashes.
From the UI: in a normal install, no. The wizard only creates rtmp_common or rtmp_custom services, and neither returns NULL: rtmp_custom derives the protocol from the server URL and falls back to "RTMP", and rtmp_common returns its stored protocol or "RTMP" (an empty one when services.json cannot be read, which is not NULL). WHIP returns "WHIP". The wizard crashes only when that service cannot be created, for example when the rtmp-services plugin is missing or fails to load: then obs_service_create() returns NULL, obs_service_get_protocol(NULL) returns NULL, and the bandwidth test crashes in can_use_output() instead of showing "no output". I have not run that in the app; it follows from the code.
Otherwise only a plugin or script that passes NULL (its own service's protocol, or a NULL protocol directly) reaches it. Low.
Proposed fix and failing test
Fix (spec-following): obs_is_output_protocol_registered(NULL) returns false, so obs_enum_output_types_with_protocol(NULL, ...) returns before the match and calls nothing; obs_enum_output_protocols() with a NULL out pointer returns false. In the frontend, can_use_output() returns false for a NULL protocol, so the wizard reaches its existing "no output" failure. A registered protocol behaves as before.
RED test (cmocka, test_output_protocol_null): registers one service output with the protocol "TESTPROTO" and calls each lookup with NULL in a forked child. Today all 3 NULL cases crash (signal 11) on libobs with the C backend, the hybrid libobs and libobs-c-reference; the control, which checks that "TESTPROTO" is still found and enumerated, passes.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Oct 22, 2026
Claiming: #1827. Test and fix are ready; PR follows.
libobs, frontend: Take a NULL protocol in the output protocol lookups
libobs, frontend: Take a NULL protocol in the output protocol lookups (…