Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-6692

fsrtl: fstub: Coverity defects fixes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • NTCore

    Description

      Coverity fixes:

      • CID 701341: Dereference before null check (ntoskrnl/fsrtl/filelock.c) -> it was certainly a check against LockInfo / FileLock>LockInformation, instead of on FileLock.
      • CID 701288: Dereference null return value (ntoskrnl/fsrtl/filelock.c) --> add a check against Conflict just before its use.
      • CID 716770: Unusued pointer value (ntoskrnl/fsrtl/filelock.c) --> Remove the unneeded RemadeElementInserted variable.

      Also in ntoskrnl/fsrtl/filelock.c :

      • Code formatting (easily localizable)
      • Rename the already declared Find variable to LockElement (in the for-loop line 938)
      • CID 701342: Dereference before null check (ntoskrnl/fsrtl/notify.c), concerning the NotifyChange variable. At this point, NotifyChange was allocated by a call to ExAllocatePoolWithTag (line 587) with the POOL_RAISE_IF_ALLOCATION_FAILURE flag. Therefore after the flag, the NotifyChange variable CANNOT be null.
      • CID 716576/7/8: Resource leak + CID 514636: Dereference after null check + CID 716805: Use after free (ntoskrnl/fstub/disksup.c) --> applying patch from Thomas Faber
        Also, simplify ZwOpenKey + ZwCreateKey --> ZwCreateKey, since the latter open an existing key if any.
      • CID 701302: Unintentional integer overflow (ntoskrnl/fstub/fstubex.c) --> cast to ULONGLONG

      WARNING !!
      =========
      In ntoskrnl/fsrtl/fastio.c, largemcb.c -> some dead and/or "bizarre" code.

      Attachments

        Issue Links

          Activity

            People

              hbelusca hbelusca
              hbelusca hbelusca
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: