Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct cvar_s {
- char *name;
- ...
- struct cvar_s *hashNext;
- } cvar_t;
- void Cvar_Restart_f( void ) {
- cvar_t *var;
- ...
- memset( var, 0, sizeof( var ) );
- ...
- }
- This is what should have been written here:
- memset( var, 0, sizeof( *var ) );
- This suspicious code was found in Wolf project by PVS-Studio static code analyzer.
- Warning message is:
- V512 A call of the 'memset' function will lead to a buffer overflow or underflow. wolf cvar.c 764
- 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