Repository navigation
requesthandler: Guard NULL list item names and string values - #1355
Open
xiaoshao9704 wants to merge 1 commit into
Open
xiaoshao9704 wants to merge 1 commit into
xiaoshao9704 wants to merge 1 commit into
Conversation
xiaoshao9704
force-pushed
the
fix/list-property-null-strings
branch
from
September 16, 2026 09:50
edde173 to
583e1bc
Compare
xiaoshao9704
added a commit
to xiaoshao9704/hearth
that referenced
this pull request
Sep 16, 2026
编码器本就是简单输出模式的一个配置项,没必要让用户回 OBS 改;按平台给候选, 选了这台机器没有的硬件编码器时 OBS 会在开播那步报错,把它的原话显示出来。 macOS 上只写设置的源一帧都不出(本机实测:换显示器 UUID、换采集类型、重写设置都不行, 日志恒为 init_screen_stream: Invalid target display ID)。上游 mac-sck 的采集初始化只认 一份异步取回的可共享内容列表,而那份列表只在打开源属性时才重新拉,所以属性窗口在 macOS 是功能必需。obs-websocket 的枚举请求本可顺带触发重建,但它会崩 OBS(5.7.4 仍未修, 已提上游 PR obsproject/obs-websocket#1355)。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
xiaoshao9704
added a commit
to xiaoshao9704/hearth
that referenced
this pull request
Sep 17, 2026
新增 listObsWindows:确保「Hearth 画面」源在(不切场景、不弹窗)之后枚举 screen_capture 的 window 属性,滤掉占位项、空名与禁用项。只枚举 window 这一个属性——application 与 display_uuid 是字符串格式的列表,占位项的值是空指针、obs-websocket 5.7.3/5.7.4 未判空, 枚举即让 OBS 段错误(已提上游 PR obsproject/obs-websocket#1355);Windows 的窗口清单同为 字符串格式、没验过,一律不碰,那边仍走壳的清单或「到 OBS 里自己选」。 配套两处:splitObsWindowLabel 把「[应用名] 窗口标题」拆开,供界面按应用分组;选定目标后 obsCaptureToTarget 不再强制弹属性窗口——让 SCK 重建可共享内容列表这件事,列窗口那一步已经 顺带做掉(与打开属性窗口同走 obs_source_properties())。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Member
|
Thanks for the contribution. Do you mind force pushing the change to use the |
obs_property_list_item_name() and obs_property_list_item_string() can return NULL for items registered by plugins (the macOS ScreenCaptureKit source lists applications without a localized name). Assigning a NULL const char* to a json value calls strlen(NULL), so GetInputPropertiesListPropertyItems on such a source crashed OBS with SIGSEGV inside obs-websocket (observed on OBS 32.1.2 / obs-websocket 5.7.3 / macOS 26.5). Substitute an empty string instead.
cursor
Bot
force-pushed
the
fix/list-property-null-strings
branch
from
November 1, 2026 11:13
583e1bc to
60aa2d7
Compare
This branch has not been deployed
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.
Title: requesthandler: Guard NULL list item names and string values
Description
GetInputPropertiesListPropertyItemscrashes OBS when a list property contains an item whose name (or string value) isNULL.Utils::Obs::ArrayHelper::GetListPropertyItemsassigns the rawconst char *returned byobs_property_list_item_name()/obs_property_list_item_string()straight into ajsonvalue. nlohmann::json constructs astd::stringfrom it, which callsstrlen(NULL)and segfaults inside the plugin.The macOS ScreenCaptureKit source (
screen_capture) registers application list items whose name can beNULL(applications without a localized name), so requesting theapplication(orwindow) property items of such a source kills OBS.Observed on OBS 32.1.2 / obs-websocket 5.7.3 / macOS 26.5. Crash report faulting thread:
Reproduction (obs-websocket 5.x client):
CreateInputwithinputKind: "screen_capture",inputSettings: {"type": 2}.GetInputPropertiesListPropertyItemswithpropertyName: "application".This change substitutes an empty string for
NULLnames / string values, matching howobs_datatreats missing strings, so the request returns the list instead of crashing.Motivation and Context
Fixes a reproducible crash triggered by a plain request; a websocket client should never be able to take OBS down.
How Has This Been Tested?
Code change is a null guard only; reproduced the crash on macOS as above. (Not rebuilt locally — please run CI.)
Types of changes
Checklist: