Skip to content

Commit

Permalink
fix: Fix a crash in firefox_addons
Browse files Browse the repository at this point in the history
Add a return When the "addons" member in the extensions JSON
is present but it's not an array,
to avoid accessing uninitialized memory.
  • Loading branch information
Smjert committed Dec 22, 2023
1 parent c396d07 commit b252159
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion osquery/tables/applications/browser_firefox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <osquery/utils/conversions/tryto.h>

namespace fs = boost::filesystem;
namespace pt = boost::property_tree;

namespace osquery {

Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit b252159

Please sign in to comment.