update(userspace) fix cppcheck warnings

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
Jason Dellaluce
2022-10-12 09:20:44 +00:00
committed by poiana
parent 3629c4dc4a
commit 57b26530b6
6 changed files with 28 additions and 6 deletions

View File

@@ -48,7 +48,7 @@ public:
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;

View File

@@ -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,

View File

@@ -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();

View File

@@ -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")
{

View File

@@ -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)
{
}

View File

@@ -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)
{
}