Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information