Skip to content

Commit

Permalink
Prevent running discovery queries when fuzzing (#7418)
Browse files Browse the repository at this point in the history
Do not run discovery queries for packs when fuzzing,
since they easily get oss-fuzz to timeout or go oom.
  • Loading branch information
Smjert authored Dec 21, 2021
1 parent 8bb44c6 commit d79a359
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion osquery/config/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,12 @@ void Config::addPack(const std::string& name,
RecursiveLock wlock(config_schedule_mutex_);
try {
schedule_->add(std::make_unique<Pack>(pack_name, source, pack_obj));
if (schedule_->last()->shouldPackExecute()) {
#ifndef OSQUERY_IS_FUZZING
bool should_pack_execute = schedule_->last()->shouldPackExecute();
#else
bool should_pack_execute = true;
#endif
if (should_pack_execute) {
applyParsers(source + FLAGS_pack_delimiter + pack_name, pack_obj, true);
}
} catch (const std::exception& e) {
Expand Down

0 comments on commit d79a359

Please sign in to comment.