Skip to content

Commit

Permalink
win: skip bad paths in dllist
Browse files Browse the repository at this point in the history
Probably needs WTF-8 support to be correct, but may avoid crashing.

Fix #38838
  • Loading branch information
vtjnash committed Dec 11, 2020
1 parent 99402b4 commit ec17c69
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,11 @@ JL_DLLEXPORT int jl_dllist(jl_array_t *list)
}
} while (cb < cbNeeded);
for (i = 0; i < cbNeeded / sizeof(HMODULE); i++) {
jl_array_grow_end((jl_array_t*)list, 1);
const char *path = jl_pathname_for_handle(hMods[i]);
// XXX: change to jl_arrayset if array storage allocation for Array{String,1} changes:
if (path == NULL)
continue;
jl_array_grow_end((jl_array_t*)list, 1);
jl_value_t *v = jl_cstr_to_string(path);
jl_array_ptr_set(list, jl_array_dim0(list) - 1, v);
}
Expand Down

0 comments on commit ec17c69

Please sign in to comment.