The vulnerability described in ISO/IEC 24772-1:2024 applies to C++. As for the C programming language, the process of linking and loading is outside the scope of the C++ standard.
In C++, the conversion of a function pointer to another type (to misdirect a pointer, for example) requires the use of a C-style cast or reinterpret_cast
. Such casts can result in unspecified behaviour, undefined behaviour or implementation-defined behaviour.
To avoid the vulnerability or mitigate its ill effects, C++ software developers can:
reinterpret_cast
or C-style casts.