Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils: Use u8path to fix possible string conversion crashes on Windows #1282

Merged
merged 1 commit into from
Feb 15, 2025

Conversation

PatTheMav
Copy link
Member

Description

Use u8path when creating a file system path via a provided std::string.

Motivation and Context

All other path operations in the code base already use u8path to ensure that the strings provided by libobs (which will either be ASCII or UTF-8 byte sequences) are correctly converted into UTF-16 strings.

Fixes #1244.

How Has This Been Tested?

Has not been tested locally, will need simple reproducer first.

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.

@RytoEX RytoEX self-assigned this Feb 12, 2025
@PatTheMav PatTheMav force-pushed the windows-filename-fix branch from 9e7b20d to 8cc8b72 Compare February 12, 2025 22:49
@tt2468
Copy link
Member

tt2468 commented Feb 15, 2025

Could this also crash on GetJsonFileContent?

@PatTheMav
Copy link
Member Author

Could this also crash on GetJsonFileContent?

Indeed it would - will amend this tomorrow.

All other path operations in the code base already use u8path to ensure
that the strings provided by libobs (which will either be ASCII or
UTF-8 byte sequences) are correctly converted into UTF-16 strings.
@tt2468 tt2468 force-pushed the windows-filename-fix branch from 8cc8b72 to eef5dcc Compare February 15, 2025 04:41
@tt2468 tt2468 merged commit 4bf9592 into obsproject:master Feb 15, 2025
1 check passed
@PatTheMav PatTheMav deleted the windows-filename-fix branch February 15, 2025 15:24
@SuslikV
Copy link

SuslikV commented Mar 13, 2025

There is other report that points to the same issue but now in the main code of OBS. This is crash report from the safe mode of OBS after the websocket plugin fails to load its settings:
https://obsproject.com/forum/threads/obs-31-0-1-crashes-on-start-100-reproducible.184488/post-675554
Would you like to take a look at this case too?

@PatTheMav
Copy link
Member Author

PatTheMav commented Mar 13, 2025

There is other report that points to the same issue but now in the main code of OBS. This is crash report from the safe mode of OBS after the websocket plugin fails to load its settings: https://obsproject.com/forum/threads/obs-31-0-1-crashes-on-start-100-reproducible.184488/post-675554 Would you like to take a look at this case too?

A crash log by itself is not sufficient to debug this, we'd also need an event log or the OBS log. GetCurrentProfile throws an exception if the value of Basic->Profile is empty or no profile with the given name was found in the profile collection.

The name in the profile collection is either the Name value in the profile itself or the UTF-8 variant of the profile file name.

Note

In general I'd advise against posting this as a comment on a closed pull request. It's a "new" issue and thus should be reported as such on the main repo. While you might make the informed assumption that it might be related, it might indeed not be and thus will not be given the necessary attention as a comment here.

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.

Unicode username causing OBS won't launch in normal mode
4 participants