diff --git a/src/flow.c b/src/flow.c index 4764aeb4fb..ac8541f11f 100644 --- a/src/flow.c +++ b/src/flow.c @@ -436,6 +436,11 @@ void FlowInitConfig(char quiet) /** set config values for memcap, prealloc and hash_size */ if ((ConfGet("flow.memcap", &conf_val)) == 1) { + if (conf_val == NULL) { + SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY,"Invalid value for flow.memcap: NULL"); + exit(EXIT_FAILURE); + } + if (ParseSizeStringU64(conf_val, &flow_config.memcap) < 0) { SCLogError(SC_ERR_SIZE_PARSE, "Error parsing flow.memcap " "from conf file - %s. Killing engine", @@ -445,6 +450,11 @@ void FlowInitConfig(char quiet) } if ((ConfGet("flow.hash-size", &conf_val)) == 1) { + if (conf_val == NULL) { + SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY,"Invalid value for flow.hash-size: NULL"); + exit(EXIT_FAILURE); + } + if (ByteExtractStringUint32(&configval, 10, strlen(conf_val), conf_val) > 0) { flow_config.hash_size = configval; @@ -452,6 +462,11 @@ void FlowInitConfig(char quiet) } if ((ConfGet("flow.prealloc", &conf_val)) == 1) { + if (conf_val == NULL) { + SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY,"Invalid value for flow.prealloc: NULL"); + exit(EXIT_FAILURE); + } + if (ByteExtractStringUint32(&configval, 10, strlen(conf_val), conf_val) > 0) { flow_config.prealloc = configval;