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

Use strcmp() to compare f_lib and JL_LIBJULIA_DL_LIBNAME #39005

Merged
merged 1 commit into from
Dec 26, 2020
Merged
Changes from all commits
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
Use strcmp() to compare f_lib and JL_LIBJULIA_DL_LIBNAME
This future-proofs us from someone trying lookup a symbol from
`libjulia.dll`, even though that should be quite rare, it may happen.
  • Loading branch information
staticfloat committed Dec 26, 2020
commit dcdb9252c71958d832a4c590c7e9405b0dd2a3b7
6 changes: 3 additions & 3 deletions src/runtime_ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ extern "C"
void *jl_get_library_(const char *f_lib, int throw_err) JL_NOTSAFEPOINT
{
void *hnd;
if (f_lib == NULL)
return jl_RTLD_DEFAULT_handle;
#ifdef _OS_WINDOWS_
if (f_lib == JL_EXE_LIBNAME)
return jl_exe_handle;
if (f_lib == JL_LIBJULIA_INTERNAL_DL_LIBNAME)
return jl_libjulia_internal_handle;
if (f_lib == JL_LIBJULIA_DL_LIBNAME)
if (strcmp(f_lib, JL_LIBJULIA_DL_LIBNAME) == 0)
return jl_libjulia_handle;
#endif
if (f_lib == NULL)
return jl_RTLD_DEFAULT_handle;
JL_LOCK_NOGC(&libmap_lock);
// This is the only operation we do on the map, which doesn't invalidate
// any references or iterators.
Expand Down