From 1a801a924e79827ab59589db0ee3f25a949043b1 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 11 May 2020 02:06:01 +0200 Subject: [PATCH] Added default values for some variables in the IpfixDbWriter This commit adds default values for two variables, ipfixId and enterpriseId, in the IpfixDbWriterSQL. Usually, these variables will always be set or an exception will be thrown, but gcc (tested with gcc 8.3.0 on debian) doesn't see this and will fail to compile due to -Werror. This commit fixes the issue by setting both variables to zero at initialization. --- src/modules/ipfix/database/IpfixDbWriterSQL.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/ipfix/database/IpfixDbWriterSQL.cpp b/src/modules/ipfix/database/IpfixDbWriterSQL.cpp index 79d29cd..33e51ab 100644 --- a/src/modules/ipfix/database/IpfixDbWriterSQL.cpp +++ b/src/modules/ipfix/database/IpfixDbWriterSQL.cpp @@ -777,8 +777,8 @@ IpfixDbWriterSQL::IpfixDbWriterSQL(const char* dbtype, const char* host, const c for(vector::const_iterator col = columns.begin(); col != columns.end(); col++) { std::string columnName = *col; std::string dataType = ""; - uint16_t ipfixId; - uint32_t enterpriseId; + uint16_t ipfixId = 0; + uint32_t enterpriseId = 0; if (useLegacyNames) { bool found = false; int i = 0;