Skip to content

Check for zero-length strings in ldLibraryPath when making newLibraryPath in RemoveLibraryPreloadEnv - #970

Merged
HerpDerpinstine merged 1 commit into
LavaGang:masterfrom
Squaduck:handle_empty_path_string_in_bootstrap
Jul 29, 2025
Merged

HerpDerpinstine merged 1 commit into
LavaGang:masterfrom
Squaduck:handle_empty_path_string_in_bootstrap

Conversation

@Squaduck

Copy link
Copy Markdown
Contributor

This prevents an ArgumentException from Path.GetFullPath(x) when LD_LIBRARY_PATH has a stray separator character.

This fixes a crash I've experienced when running a Linux native game with the recommended launch options.
Eg: If you run a game with LD_LIBRARY_PATH="/full/path/to/game/directory:$LD_LIBRARY_PATH" LD_PRELOAD="libversion.so" %command% and LD_LIBRARY_PATH is unset (like it is for me on openSUSE), LD_LIBRARY_PATH will have a stray separator character at the end like "/foo/bar:"
string.Split(':') will split this as as ["/foo/bar", ""], and then this empty string will be passed into Path.GetFullPath(x) which throws an ArgumentException when given an empty string.

I have tested this this and works for me.

…Path

This prevents an ArgumentException from Path.GetFullPath(x) when LD_LIBRARY_PATH has a stray separator character
@HerpDerpinstine
HerpDerpinstine merged commit a81fe06 into LavaGang:master Jul 29, 2025
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.

2 participants