in mmap_posix, failed map() followed by close() may result in attempt to close an invalid handle

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Minor - P4
    • 1.9.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      In MemoryMappedFile::map(), fd is assigned to ::open() but is not reset to zero if ::open() fails. This can result in an attempt to close an invalid file handle in MemoryMappedFile::close(). Not necessarily a problem, but if we are doing any syscall auditing or if we check the return value of ::close at some point (which wouldn't be a bad idea) we will notice failures.

            Assignee:
            Mathias Stearn
            Reporter:
            Aaron Staple (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: