Advertisement
PVS-StudioWarnings

PVS-Studio warning V506 for WinSCP

Nov 24th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. void __fastcall TCustomScpExplorerForm::EditorAutoConfig()
  2. {
  3.   ....
  4.   else
  5.   {
  6.     ....
  7.     TEditorList EditorList;
  8.     EditorList = *WinConfiguration->EditorList;
  9.     EditorList.Insert(0, new TEditorPreferences(EditorData));
  10.     WinConfiguration->EditorList = &EditorList;
  11.   }
  12.   ....
  13. }
  14.  
  15. This suspicious code was found in WinSCP project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V506 Pointer to local variable 'EditorList' is stored outside the scope of this variable. Such a pointer will become invalid. customscpexplorer.cpp 2633
  18.  
  19. 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
Advertisement