projects
/
platform
/
upstream
/
coreclr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
75e112f
)
add access(2) call before dlopening files
author
Yaroslav Yamshchikov
<y.yamshchiko@samsung.com>
Thu, 18 Jul 2019 10:14:14 +0000
(13:14 +0300)
committer
Gleb Balykov
<g.balykov@samsung.com>
Wed, 25 Mar 2020 12:29:41 +0000
(15:29 +0300)
src/pal/src/loader/module.cpp
patch
|
blob
|
history
diff --git
a/src/pal/src/loader/module.cpp
b/src/pal/src/loader/module.cpp
index
dc4c8ba
..
c817ffe
100644
(file)
--- a/
src/pal/src/loader/module.cpp
+++ b/
src/pal/src/loader/module.cpp
@@
-1428,6
+1428,15
@@
static NATIVE_LIBRARY_HANDLE LOADLoadLibraryDirect(LPCSTR libraryNameOrPath)
_ASSERTE(libraryNameOrPath != nullptr);
_ASSERTE(libraryNameOrPath[0] != '\0');
+ if (strchr(libraryNameOrPath, '/') != nullptr)
+ {
+ if (access(libraryNameOrPath, F_OK) == -1)
+ {
+ SetLastError(ERROR_MOD_NOT_FOUND);
+ return (NATIVE_LIBRARY_HANDLE)nullptr;
+ }
+ }
+
NATIVE_LIBRARY_HANDLE dl_handle = dlopen(libraryNameOrPath, RTLD_LAZY);
if (dl_handle == nullptr)
{