Skip to content

Commit

Permalink
[release/6.0] Fix null being passed to g_path_get_dirname when probin…
Browse files Browse the repository at this point in the history
…g in wasm (#84740)

* [6.0-staging] Bump branding to 6.0.18 (#84596)

* Fix null being passed to g_path_get_dirname when probing in wasm

* Update src/mono/mono/metadata/native-library.c

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>

* Revert versioning changes brought from staging.

---------

Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
Co-authored-by: Katelyn Gadd <kg@luminance.org>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
  • Loading branch information
4 people authored Apr 12, 2023
1 parent 066cc87 commit 51e6047
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mono/mono/metadata/native-library.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ 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) != 0 && image != NULL &&
module == NULL && (image->filename != NULL)) {
char *mdirname = g_path_get_dirname (image->filename);
if (mdirname)
module = netcore_probe_for_module_variations (mdirname, file_name, lflags);
Expand Down

0 comments on commit 51e6047

Please sign in to comment.