PVS-StudioWarnings

PVS-Studio warning V678 for Shareaza

Nov 20th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. void CDownloadWithSources::MergeMetadata(
  2.   const CXMLElement* pXML)
  3. {
  4.   CQuickLock pLock( Transfers.m_pSection );
  5.  
  6.   CXMLAttribute* pAttr1 =
  7.     m_pXML->GetAttribute(CXMLAttribute::schemaName);
  8.   CXMLAttribute* pAttr2 =
  9.     pXML->GetAttribute(CXMLAttribute::schemaName);
  10.  
  11.   if (pAttr1 && pAttr2 &&
  12.       !pAttr1->GetValue().CompareNoCase(pAttr1->GetValue()))
  13.     ....
  14. }
  15.  
  16. This suspicious code was found in Shareaza project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V678 An object is used as an argument to its own method. Consider checking the first actual argument of the 'CompareNoCase' function. downloadwithsources.cpp 1281
  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