Skip to content

requesthandler: Fix GtCurrentProgramScene crash - #1353

Open
andrewsoncha wants to merge 1 commit into
obsproject:masterfrom
andrewsoncha:requesthandler/sceneNameCheck
Open

andrewsoncha wants to merge 1 commit into
obsproject:masterfrom
andrewsoncha:requesthandler/sceneNameCheck

Conversation

@andrewsoncha

Copy link
Copy Markdown

Description

Added checks for a null current program scene in GetCurrentProgramScene. When the current program scene is null, the sceneName and sceneUuid are returned as None (nullptr).

Motivation and Context

As highlighted in this issue (#1349), OBS to crashes due to a null pointer dereference when the current program scene is deleted and the GetCurrentProgramScene Request is made. This is because there are no guards against null program scenes in the GetCurrentProgramScene RequestHandler code.

How Has This Been Tested?

Tested OS(s): MacOS Tanhoe 26.2 (Apple Silicon M2)

The code was tested using the reproduction script included in the issue (#1349). Running the reproduction script did not cause OBS to crash. The output of the reproduction script is as follows:

Connecting to ws://127.0.0.1:4455 ...
Identified.

  OBS 32.1.0 / obs-websocket 5.7.2 on macOS 26.2

1. Enabling Studio Mode
2. Creating throwaway scene 'repro-victim-kzohzg'
3. Making it the Program scene
4. Removing it — OBS is now left without a Program scene
5. Polling GetCurrentProgramScene while the removal settles ...
    after 0.5s -> None

NOT reproduced — GetCurrentProgramScene returned: {'currentProgramSceneName': None, 'currentProgramSceneUuid': None, 'sceneName': None, 'sceneUuid': None}
OBS still has a valid Program scene, so the null path wasn't hit.

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the Contributing Guidelines.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • My code is not on master or a release/* branch.
  • The code has been tested.
  • I have included updates to all appropriate documentation.

Added checks for a null current program scene in
GetCurrentProgramScene. When the current program scene is null,
the returning sceneName and sceneUuid are nullptr.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant