Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define CHD_SHA1_BYTES 20
- #define CHD_V4_HEADER_SIZE 108
- #define CHD_MAX_HEADER_SIZE CHD_V4_HEADER_SIZE
- static chd_error header_read(...., chd_header *header)
- {
- UINT8 rawheader[CHD_MAX_HEADER_SIZE];
- ...
- memcpy(header->parentsha1, &rawheader[100],
- CHD_SHA1_BYTES);
- ...
- }
- This suspicious code was found in MAME project by PVS-Studio static code analyzer.
- Warning message is:
- V512 A call of the 'memcpy' function will lead to the '& rawheader[100]' buffer becoming out of range. chd.c 1870
- 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