Repository navigation
Conversation
PatTheMav
requested changes
Nov 23, 2026
Comment on lines
+487
to
+491
| uint32_t major = 0; | ||
| uint32_t minor = 0; | ||
| uint32_t patch = 0; | ||
|
|
||
| sscanf(version, "%u.%u.%u", &major, &minor, &patch); |
Member
There was a problem hiding this comment.
At first glance I see multiple issues with this:
- The
%uconversion specifier produces anunsigned int, which indeed is a 32-bit wide type in C. Thus a version like512.12.765will be correctly parsed. - But encoding each version token in a 32-bit unsigned integer (as this function does) introduces an invariant, depending on the number of version tokens used.
- For 3 tokens (as thus function does), one could use 10-bit encoding (maximum token value of 1024).
- But OBS has been using 8-bit encoding instead, so the maximum token value is 255.
- Which means that a version like
512.12.765cannot be correctly encoded, even though it is a valid "semantic version string".
This function thus either has to ensure that each version token stays below 256, change the encoding to 10-bit and ensure that the token stays below 1024, use a struct rather than an encoded 32-bit number (as it should IMO), or use a 64-bit number.
Member
Author
There was a problem hiding this comment.
Updated to a struct and moved it and the helper functions to their own file.
|
|
||
| static bool module_is_restricted(obs_module_t *module) | ||
| { | ||
| for (size_t i = 0; i < sizeof(restricted_modules) / sizeof(restricted_modules[0]); i++) { |
Member
There was a problem hiding this comment.
The compiler probably optimises this into constants automatically, but for readability it wouldn't hurt to store this length as a size value outside of the loop declaration.
While we're at it, it should also use pre-increment.
Warchamp7
force-pushed
the
plugin-manifest-restrict
branch
from
December 3, 2026 01:08
bd8754e to
5fe4324
Compare
These are commonly used plugins which also feature a lot of complex functionality. We want to ensure users are on at least a moderately up to date version of them, at least until we have in-app updating and can restrict plugins entirely by libobs version.
Warchamp7
force-pushed
the
plugin-manifest-restrict
branch
from
December 3, 2026 01:11
5fe4324 to
bf1aff5
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.
Description
Adds an additional check when loading third party modules to ensure a specific list of plugins meet a minimum version requirement, specified via their manifest file.
Motivation and Context
These are commonly used plugins which also feature a lot of complex functionality. All of them come up pretty frequently in crash reports.
It is possible if not likely that in many of those cases, they are outdated versions that we place no limitation on.
We want to ensure users are on at least a moderately up to date version of them (at least until we have in-app updating and can restrict plugins on every major update). These plugins all distribute versions that include a manifest now, so we can check the version in there during load.
How Has This Been Tested?
I've loaded the current version of each of these plugins successfully in a RelWithDebInfo build.
I set the minimum version to versions higher than this commit and verified each of them then failed to load.
I also deleted the manifest files for each of these plugins, and verified they failed to load.
Types of changes
Checklist: