mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Partially fix type of function pointer.
Found using UBSan. Full fix would require adding visibility attribute to CUser, CIRCNetwork, CModule, CModuleEntry, CModInfo *and* make sure these attributes are visible to enough code. The second statement is more difficult to fulfill, because forward declaration of CUser is not enough, because the attribute is on class definition. So Modules.h would need to include many other includes. Probably it should be changed at some point. See http://stackoverflow.com/questions/27976687/clangs-ubsan-function-pointer-is-this-illegal
This commit is contained in:
@@ -1917,7 +1917,7 @@ ModHandle CModules::OpenModule(const CString& sModule, const CString& sModPath,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CModuleEntry* (*fpZNCModuleEntry)() = nullptr;
|
||||
const CModuleEntry* (*fpZNCModuleEntry)() = nullptr;
|
||||
// man dlsym(3) explains this
|
||||
*reinterpret_cast<void**>(&fpZNCModuleEntry) = dlsym(p, "ZNCModuleEntry");
|
||||
if (!fpZNCModuleEntry) {
|
||||
|
||||
Reference in New Issue
Block a user