PVS-StudioWarnings

PVS-Studio warning V512 for iecsdk

Nov 26th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. typedef struct _plh_dynamic_pl_folder_info {
  2. ...
  3. } PLH_DYNAMIC_PL_FOLDER_INFO, *PPLH_DYNAMIC_PL_FOLDER_INFO;
  4.  
  5. int plh_dynamic_read_pl_folder(
  6.   PPLH_DYNAMIC_PL_FOLDER_INFO pconfig)
  7. {
  8.   ...
  9.   memset(
  10.     pconfig,
  11.     0,
  12.     sizeof(pconfig)
  13.   );
  14.   ...
  15. }
  16.  
  17. This is what should have been written here: sizeof(*pconfig)
  18.  
  19. This suspicious code was found in iecsdk project by PVS-Studio static code analyzer.
  20. Warning message is:
  21. V512 A call of the 'memset' function will lead to underflow of the buffer 'pconfig'. pl_csv_logger productivity_link_helper.c 1806
  22.  
  23. 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