From 6b3ae42f7894432e9a19d43d45b1cabbb44f4ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=8C=E8=8D=89=E9=85=B8=E9=85=AF?= <17663689+kotori2@users.noreply.github.com> Date: Tue, 9 Feb 2021 23:27:28 +0800 Subject: [PATCH] [native api] fix null as dlopen file name (#112) --- core/src/main/cpp/main/src/native_api.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/main/cpp/main/src/native_api.cpp b/core/src/main/cpp/main/src/native_api.cpp index 8ce2b51e..4efa7951 100644 --- a/core/src/main/cpp/main/src/native_api.cpp +++ b/core/src/main/cpp/main/src/native_api.cpp @@ -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;