Skip to content

Commit

Permalink
update(userspace) fix cppcheck warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Dellaluce <[email protected]>
jasondellaluce authored and poiana committed Oct 12, 2022

Verified

This commit was signed with the committer’s verified signature.
DrJosh9000 Josh Deprez
1 parent 3629c4d commit 57b2653
Showing 6 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion userspace/engine/filter_warning_resolver.h
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ class filter_warning_resolver
private:
struct visitor : public libsinsp::filter::ast::base_expr_visitor
{
visitor(): m_is_equality_check(false) {}
visitor(): m_is_equality_check(false), m_warnings(nullptr) {}
visitor(visitor&&) = default;
visitor& operator = (visitor&&) = default;
visitor(const visitor&) = delete;
4 changes: 2 additions & 2 deletions userspace/engine/rule_loader.h
Original file line number Diff line number Diff line change
@@ -167,7 +167,7 @@ namespace rule_loader

struct warning
{
warning(): ctx("no-filename-given") {}
warning(): wc(falco::load_result::warning_code::LOAD_UNKNOWN_SOURCE), ctx("no-filename-given") {}
warning(
falco::load_result::warning_code w,
const std::string& m,
@@ -184,7 +184,7 @@ namespace rule_loader

struct error
{
error(): ctx("no-filename-given") {}
error(): ec(falco::load_result::error_code::LOAD_ERR_FILE_READ), ctx("no-filename-given") {}
error(
falco::load_result::error_code e,
const std::string& m,
4 changes: 2 additions & 2 deletions userspace/falco/app_actions/print_version.cpp
Original file line number Diff line number Diff line change
@@ -38,8 +38,8 @@ application::run_result application::print_version()
unsigned long driver_schema_minor = PPM_API_VERSION_MINOR(driver_schema_version);
unsigned long driver_schema_patch = PPM_API_VERSION_PATCH(driver_schema_version);
printf("Driver:\n");
printf(" API version: %ld.%ld.%ld\n", driver_api_major, driver_api_minor, driver_api_patch);
printf(" Schema version: %ld.%ld.%ld\n", driver_schema_major, driver_schema_minor, driver_schema_patch);
printf(" API version: %lu.%lu.%lu\n", driver_api_major, driver_api_minor, driver_api_patch);
printf(" Schema version: %lu.%lu.%lu\n", driver_schema_major, driver_schema_minor, driver_schema_patch);
printf(" Default driver: %s\n", DRIVER_VERSION);

return run_result::exit();
3 changes: 3 additions & 0 deletions userspace/falco/app_cmdline_options.cpp
Original file line number Diff line number Diff line change
@@ -30,7 +30,10 @@ namespace app {
cmdline_options::cmdline_options()
: event_buffer_format(sinsp_evt::PF_NORMAL),
gvisor_config(""),
list_fields(false),
list_plugins(false),
list_syscall_events(false),
markdown(false),
modern_bpf(false),
m_cmdline_opts("falco", "Falco - Cloud Native Runtime Security")
{
18 changes: 18 additions & 0 deletions userspace/falco/configuration.cpp
Original file line number Diff line number Diff line change
@@ -32,13 +32,31 @@ limitations under the License.
using namespace std;

falco_configuration::falco_configuration():
m_json_output(false),
m_json_include_output_property(true),
m_json_include_tags_property(true),
m_notifications_rate(0),
m_notifications_max_burst(1000),
m_watch_config_files(true),
m_buffered_outputs(false),
m_time_format_iso_8601(false),
m_output_timeout(2000),
m_grpc_enabled(false),
m_grpc_threadiness(0),
m_webserver_enabled(false),
m_webserver_threadiness(0),
m_webserver_listen_port(8765),
m_webserver_k8s_healthz_endpoint("/healthz"),
m_webserver_ssl_enabled(false),
m_syscall_evt_drop_threshold(.1),
m_syscall_evt_drop_rate(.03333),
m_syscall_evt_drop_max_burst(1),
m_syscall_evt_simulate_drops(false),
m_syscall_evt_timeout_max_consecutives(1000),
m_metadata_download_max_mb(100),
m_metadata_download_chunk_wait_us(1000),
m_metadata_download_watch_freq_sec(1),
m_syscall_buf_size_preset(4),
m_config(NULL)
{
}
3 changes: 2 additions & 1 deletion userspace/falco/event_drops.cpp
Original file line number Diff line number Diff line change
@@ -24,7 +24,8 @@ syscall_evt_drop_mgr::syscall_evt_drop_mgr():
m_inspector(NULL),
m_outputs(NULL),
m_next_check_ts(0),
m_simulate_drops(false)
m_simulate_drops(false),
m_threshold(0)
{
}

0 comments on commit 57b2653

Please sign in to comment.