Bugfix: Wrong values for flowRate in ipfixSampler lead to crashes

Too small or low values in the configuration of ipfixSampler can
lead to floating point exceptions during runtime.
master
Lothar Braun 2020-05-14 23:40:37 +02:00
parent 65a3034df9
commit d396c68d15
1 changed files with 3 additions and 0 deletions

View File

@ -42,6 +42,9 @@ IpfixSamplerCfg::IpfixSamplerCfg(XMLElement* elem)
if (e->matches("flowrate")) {
flowRate = getDouble("flowrate");
if (flowRate <= 0 || flowRate > 1){
THROWEXCEPTION("Illegal value for flowRate. Must be greater 0 and smaller or equal to 1, received %lf", flowRate);
}
} else if (e->matches("next")) { // ignore next
} else {
msg(LOG_CRIT, "Unknown IpfixSampler config statement %s\n", e->getName().c_str());