PVS-StudioWarnings

PVS-Studio warning V595 for Firefox

Nov 12th, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. void
  2. nsHttpTransaction::RestartVerifier::Set(int64_t contentLength,
  3.                                         nsHttpResponseHead *head)
  4. {
  5.   if (mSetup)
  6.     return;
  7.  
  8.   if (head->Status() != 200)
  9.     return;
  10.  
  11.   mContentLength = contentLength;
  12.  
  13.   if (head) {
  14.   ....
  15. }
  16.  
  17. This suspicious code was found in Firefox project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V595 The 'head' pointer was utilized before it was verified against nullptr. Check lines: 1915, 1920. nshttptransaction.cpp 1915
  20.  
  21. 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