You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just noticed this when running cppcheck over the code. This code is very dangerous:
There's no guarantee that the compiler puts these arrays into sequential memory locations, so this could potentially overwrite unrelated memory locations
The compiler is free to change the alignment. So even if the arrays are put into sequential memory locations, there could be added bytes for padding, depending on architecture. That would result in not all bytes being zeroed
If someone changes the code unaware of that memset (e. g. adding / removing / moving around some of the arrays), a lot bad stuff happen :)
Overflow risk in
Dhcp.cpp
._dhcpLocalIp has only 4 byte.
Every variable should be filled separate with zeros.
The text was updated successfully, but these errors were encountered: