[native api] fix null as dlopen file name (#112)

This commit is contained in:
双草酸酯 2021-02-09 23:27:28 +08:00 committed by GitHub
parent 4294e4bf42
commit 6b3ae42f78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -55,7 +55,12 @@ namespace lspd {
void*, do_dlopen, (const char* name, int flags, const void* extinfo,
const void* caller_addr), {
auto *handle = backup(name, flags, extinfo, caller_addr);
std::string ns(name);
std::string ns;
if (name) {
ns = std::string(name);
} else {
ns = "NULL";
}
LOGD("native_api: do_dlopen(%s)", name);
if (handle == nullptr) {
return nullptr;