PVS-StudioWarnings

PVS-Studio warning V522 for ReactOS

Nov 10th, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. static void
  2. acpi_bus_notify (....)
  3. {
  4.   struct acpi_device *device = NULL;
  5.   ....
  6.   switch (type) {
  7.     ....
  8.     case ACPI_NOTIFY_EJECT_REQUEST:
  9.       DPRINT1("Received EJECT REQUEST "
  10.               "notification for device [%s]\n",
  11.               device->pnp.bus_id);
  12.       /* TBD */
  13.       break;
  14.     ....
  15.   }
  16. }
  17.  
  18. This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V522 Dereferencing of the null pointer 'device' might take place. bus.c 762
  21.  
  22. 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