PVS-StudioWarnings

PVS-Studio warning V576 for Xerces

Nov 18th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. define XERCES_U64BIT_INT UINT64
  2. typedef XERCES_U64BIT_INT XMLUInt64;
  3. typedef XMLUInt64 XMLFileLoc;
  4. XMLFileLoc SAXParseException::getLineNumber() const;
  5.  
  6. void ParseErrorHandler::error(const SAXParseException& e)
  7. {
  8.   ....
  9.   fprintf(stderr,
  10.     "\nError at file \"%s\", line %d, char %d:  %s\n",
  11.     systemId, e.getLineNumber(),
  12.     e.getColumnNumber(), message);
  13.   ....
  14. }
  15.  
  16. This suspicious code was found in Xerces project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V576 Incorrect format. Consider checking the fourth actual argument of the 'fprintf' function. The argument is expected to be not greater than 32-bit. encodingtest.cpp 74
  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