diff --git a/userspace/falco/configuration.cpp b/userspace/falco/configuration.cpp index c8303486..ad4de781 100644 --- a/userspace/falco/configuration.cpp +++ b/userspace/falco/configuration.cpp @@ -254,8 +254,17 @@ void falco_configuration::init(string conf_filename, list &cmdline_optio } m_metadata_download_max_mb = m_config->get_scalar("metadata_download", "max_mb", 100); + if(m_metadata_download_max_mb > 1024) + { + throw logic_error("Error reading config file(" + m_config_file + "): metadata download maximum size should be < 1024 Mb"); + } m_metadata_download_chunk_wait_us = m_config->get_scalar("metadata_download", "chunk_wait_us", 1000); m_metadata_download_watch_freq_sec = m_config->get_scalar("metadata_download", "watch_freq_sec", 1); + if(m_metadata_download_watch_freq_sec == 0) + { + throw logic_error("Error reading config file(" + m_config_file + "): metadata download watch frequency seconds must be an unsigned integer > 0"); + } + } void falco_configuration::read_rules_file_directory(const string &path, list &rules_filenames)