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

Fix null being passed to g_path_get_dirname when probing in wasm #60445

Merged
merged 2 commits into from
Oct 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/mono/mono/metadata/native-library.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,10 @@ netcore_probe_for_module (MonoImage *image, const char *file_name, int flags)
module = netcore_probe_for_module_variations (pinvoke_search_directories[i], file_name, lflags);

// Check the assembly directory if the search flag is set and the image exists
if (flags & DLLIMPORTSEARCHPATH_ASSEMBLY_DIRECTORY && image != NULL && module == NULL) {
if (
flags & DLLIMPORTSEARCHPATH_ASSEMBLY_DIRECTORY && image != NULL &&
module == NULL && (image->filename != NULL)
) {
kg marked this conversation as resolved.
Show resolved Hide resolved
char *mdirname = g_path_get_dirname (image->filename);
if (mdirname)
module = netcore_probe_for_module_variations (mdirname, file_name, lflags);
Expand Down