Anti-DDoS program module indirectly transmits STL instance objects through struct
We often pass parameters to functions through struct. In principle, the struct should not contain non-pod members.
[Reference]
========================================================== ==========================================
Pod, short for plain old data, a common old data structure (POD) is a data structure. It is used only as the field value of passive favorites, and does not use the packet or otherobject-oriented feature. (A plain old data structure (POD) is a data structurethat is represented only as passive collections of field values, without using encapsulationor otherobject-orientedfeatures .)
========================================================== ==========================================
For more information, see the following post:
Struct definition should not contain non-built-in type members
Http://www.pc.nd/index.php? Doc-view-10894 (company intranet, cannot access, please forgive me)
Unfortunately, we often include non-pod members in the struct. Of course, aside from the issues mentioned in the above post (problems caused by memset (& info, 0, sizeof (Info);), there seems to be no worries, this applies even if the STL instance object is included. Indeed, in the same program module, such problems can be avoided with a little attention.
However, such behavior is highly risky when data is transmitted between multiple modules.
First of all, it is very dangerous to pass STL instance objects between modules, and the resulting crash is difficult to troubleshoot. For related problems, please refer to the following two posts:
DLL Import and Export STL class objects cause a crash
Http://www.pc.nd/index.php? Doc-view-12643 (company intranet, cannot access, please forgive me)
Cross-dll stl exception
Http://www.pc.nd/index.php? Doc-view-12743 (company intranet, cannot access, please forgive me)
In addition, if the STL instance object is indirectly transmitted to functions in other modules through the struct, the danger is hidden and becomes a difficult trap to discover. For example, a struct directly contains members of an STL instance object. In addition, a struct contains a custom type object, which directly or indirectly contains members of an STL instance object.
When other modules access the elements in this STL instance object, the program will crash when mines break out!