PVS-StudioWarnings

PVS-Studio warning V595 for KDE4

Nov 11th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. void KDoubleNumInput::spinBoxChanged(double val)
  2. {
  3.   ....
  4.   const double slidemin = priv->slider->minimum();      //<==
  5.   const double slidemax = priv->slider->maximum();      //<==
  6.   ....
  7.   if (priv->slider) {                                   //<==
  8.     priv->slider->blockSignals(true);
  9.     priv->slider->setValue(qRound(slidemin + rel * (....)));
  10.     priv->slider->blockSignals(false);
  11.   }
  12. }
  13.  
  14. This suspicious code was found in KDE4 project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V595 The 'priv->slider' pointer was utilized before it was verified against nullptr. Check lines: 786, 792. knuminput.cpp 786
  17.  
  18. 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