Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1935437 - Check in case libName could be nullptr before passing i…
…t inside the std::string constructor in LoadedLibraryInfo constructor r=profiler-reviewers,florian Before the shared-libraries code deduplication, we were using nsCString for the `LoadedLibraryInfo::mName`. After the deduplication we started to use `std::string`. Before, it was fine to pass nullptr as a parameter to nsCString as it could easily handle it and act as if it's an empty string. But it's an undefined behavior on `std::string`. And passing a nullptr actively crashes Firefox when there is a BHR hang detected (as it uses the shared libraries code). So now, instead of directly passing `dl_info->dlpi_name` inside `std::string`, I'm checking if it's a nullptr or not, and if so I'm passing an empty string so we don't crash there. Differential Revision: https://phabricator.services.mozilla.com/D231926 UltraBlame original commit: 2cb187c7d3f15302a7c2665b10157f50155cdbf1
- Loading branch information