PVS-StudioWarnings

PVS-Studio warning V519 for ReactOS

Nov 10th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. #define IRP_MJ_INTERNAL_DEVICE_CONTROL    0x0f
  2. #define IRP_MJ_SCSI                       0x0f
  3.  
  4. ULONG NTAPI
  5. ScsiPortInitialize(....)
  6. {
  7.   ...
  8.   DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] =
  9.     ScsiPortDeviceControl;
  10.   DriverObject->MajorFunction[IRP_MJ_SCSI] =
  11.     ScsiPortDispatchScsi;
  12.   ...
  13. }
  14.  
  15. This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V519 The 'DriverObject->MajorFunction [0x0f]' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1058, 1059. scsiport scsiport.c 1059
  18.  
  19. 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