From b252159df08bad475c7248236720e858868d59f5 Mon Sep 17 00:00:00 2001 From: Stefano Bonicatti Date: Fri, 22 Dec 2023 20:58:46 +0100 Subject: [PATCH] fix: Fix a crash in firefox_addons Add a return When the "addons" member in the extensions JSON is present but it's not an array, to avoid accessing uninitialized memory. --- osquery/tables/applications/browser_firefox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osquery/tables/applications/browser_firefox.cpp b/osquery/tables/applications/browser_firefox.cpp index f21990104aee..c3546915d344 100644 --- a/osquery/tables/applications/browser_firefox.cpp +++ b/osquery/tables/applications/browser_firefox.cpp @@ -17,7 +17,6 @@ #include namespace fs = boost::filesystem; -namespace pt = boost::property_tree; namespace osquery { @@ -120,6 +119,7 @@ void genFirefoxAddonsFromExtensions(const std::string& uid, TLOG << "Unrecognized format for the 'addons' member in the extensions " "file at: " << extensions_path << ", it's not an array"; + return; } for (const auto& addon : addons.GetArray()) {