Merge pull request #141 from constcast/ipfix-sampler-crash

Bugfix: Wrong values for flowRate in ipfixSampler lead to crashes
master
Lothar Braun 2020-05-27 08:52:58 +02:00 committed by GitHub
commit 973ec2fb9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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());