diff options
author | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2020-10-28 13:04:53 +0200 |
---|---|---|
committer | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2020-11-03 12:06:14 +0000 |
commit | a95ddcf97bcb3c5a6727fcaf6b3b74c05051ac4f (patch) | |
tree | 23c17186bce8222b59ce9eaf2b7deca63f96b9ec /src/corelib/plugin | |
parent | 7d875b4306dbd144afb332389e75dba331986cca (diff) |
Android: fix crash by passing the right Handle to dlsym()
dlsym() should be taking a Handle that is created by dlopen() instead of
pHnd.
* https://linux.die.net/man/3/dlsym
Fixes: QTBUG-84849
Pick-to: 5.15
Change-Id: Ic192736268ef9cbfdb86cf66d20082b14070ba00
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r-- | src/corelib/plugin/qlibrary_unix.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp index 46139b760e..95aeee8732 100644 --- a/src/corelib/plugin/qlibrary_unix.cpp +++ b/src/corelib/plugin/qlibrary_unix.cpp @@ -243,10 +243,10 @@ bool QLibraryPrivate::load_sys() } if (hnd) { using JniOnLoadPtr = jint (*)(JavaVM *vm, void *reserved); - JniOnLoadPtr jniOnLoad = reinterpret_cast<JniOnLoadPtr>(dlsym(pHnd, "JNI_OnLoad")); + JniOnLoadPtr jniOnLoad = reinterpret_cast<JniOnLoadPtr>(dlsym(hnd, "JNI_OnLoad")); if (jniOnLoad && jniOnLoad(QtAndroidPrivate::javaVM(), nullptr) == JNI_ERR) { dlclose(hnd); - pHnd = nullptr; + hnd = nullptr; } } #endif |