PVS-StudioWarnings

PVS-Studio warning V595 for Chromium

Nov 10th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. void TestingAutomationProvider::IsPageActionVisible(
  2.     base::DictionaryValue* args,
  3.     IPC::Message* reply_message) {
  4.   ....
  5.   Browser* browser = automation_util::GetBrowserForTab(tab);
  6.   const Extension* extension;
  7.   if (!GetEnabledExtensionFromJSONArgs(
  8.           ...., browser->profile(), ....)) {
  9.     reply.SendError(error);
  10.     return;
  11.   }
  12.   if (!browser) {
  13.     reply.SendError("Tab does not belong to an open browser");
  14.     return;
  15.   }
  16.   ....
  17. }
  18.  
  19. This suspicious code was found in Chromium project by PVS-Studio static code analyzer.
  20. Warning message is:
  21. V595 The 'browser' pointer was utilized before it was verified against nullptr. Check lines: 5489, 5493. testing_automation_provider.cc 5489
  22.  
  23. 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