PVS-StudioWarnings

PVS-Studio warning V595 for MAME

Nov 26th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. static void find_software_item(....)
  2. {
  3.   char *software_list_ptr = NULL;
  4.   ...
  5.   *software_list_ptr =
  6.     software_list_open( options, swlist_name, FALSE, NULL );
  7.   if ( software_list_ptr )
  8.   {
  9.     *software_info_ptr =
  10.       software_list_find( *software_list_ptr, swname, NULL );
  11.   ...
  12. }
  13.  
  14. Most likely this is what should be written here: if ( *software_list_ptr )
  15.  
  16. This suspicious code was found in MAME project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V595 The 'software_list_ptr' pointer was utilized before it was verified against nullptr. Check lines: 1586, 1591.  softlist.c 1586
  19.  
  20. 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