Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct ICheat
- {
- uint32 address;
- uint32 new_val;
- uint32 saved_val;
- int size;
- bool8 enabled;
- bool8 saved;
- char name [22];
- int format;
- };
- struct SCheat
- {
- uint32 address;
- uint8 byte;
- uint8 saved_byte;
- bool8 saved;
- };
- void RamWatchEnableCommand(....)
- {
- ....
- struct ICheat cht;
- ....
- ZeroMemory(&cht, sizeof(struct SCheat));
- ....
- }
- Most likely this is what should be written here: ZeroMemory(&cht, sizeof(struct ICheat));
- This suspicious code was found in Snes9x project by PVS-Studio static code analyzer.
- Warning message is:
- V512 A call of the 'memset' function will lead to underflow of the buffer '& cht'. ramwatch.cpp 1199
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment