Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD Fix getLoadedLibraries() crash #2672

Merged
merged 1 commit into from
Jul 2, 2023

Commits on Jul 1, 2023

  1. FreeBSD Fix getLoadedLibraries() crash

    FreeBSD's getLoadedLibraries() uses libprocstat(3) to obtain
    the list of mapped files (libraries). However, the list
    obtained from procstat_getfiles() does not only return regular files,
    but might also return anonymous objects that have no fs->path.
    
    With exiv2 v0.28, I had also observed crashes with a real TTY,
    and the entry->fs_path dereference would crash, even if it
    was only for a test "non-null", so we need something more thorough.
    
    Add a check to only consider VNODEs (actual file system entries),
    and also make sure that entry->fs_path is defined so we don't
    pass a nullptr to the std::string(const char *) constructor when
    we are reading corrupt data. std::string((const char *)0)
    on FreeBSD 13.2 - calls strlen() and crashes there.
    mandree committed Jul 1, 2023
    Configuration menu
    Copy the full SHA
    4d1b153 View commit details
    Browse the repository at this point in the history