config/flow: fix division by zero

Fixes: 805b07fa42 ("src: checks to avoid divisions by zero")

Coverity id: 1539152

Ticket: #5920
Ticket: #6255
pull/9441/head
Philippe Antoine 3 years ago committed by Victor Julien
parent b67ff4badf
commit 541cafa40a

@ -606,10 +606,11 @@ void FlowInitConfig(bool quiet)
FatalError("Invalid value for flow.hash-size: NULL");
}
if (StringParseUint32(&configval, 10, strlen(conf_val), conf_val) > 0 || configval == 0) {
if (StringParseUint32(&configval, 10, strlen(conf_val), conf_val) && configval != 0) {
flow_config.hash_size = configval;
} else {
FatalError("Invalid value for flow.hash-size");
FatalError("Invalid value for flow.hash-size. Must be a numeric value in the range "
"1-4294967295");
}
}
if ((ConfGet("flow.prealloc", &conf_val)) == 1)

Loading…
Cancel
Save