PVS-StudioWarnings

PVS-Studio warning V595 for wxWidgets

Nov 18th, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. void wxAuiToolBar::OnRightDown(wxMouseEvent& evt)
  2. {
  3.   ...
  4.   if (m_overflowSizerItem)
  5.   {
  6.     int dropdown_size =
  7.       m_art->GetElementSize(wxAUI_TBART_OVERFLOW_SIZE);
  8.     if (dropdown_size > 0 &&
  9.       evt.m_x > cli_rect.width - dropdown_size &&
  10.       evt.m_y >= 0 &&
  11.       evt.m_y < cli_rect.height &&
  12.       m_art)
  13.     {
  14.        return;
  15.     }
  16.   }
  17.   ...
  18. }
  19.  
  20. This suspicious code was found in wxWidgets project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V595 The 'm_art' pointer was utilized before it was verified against nullptr. Check lines: 2659, 2664. aui auibar.cpp 2659
  23.  
  24. 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