Enforce variable init
There were a few places we weren't initting our variables per cpp core
guidelines. Fix all of them, and enable checks for this.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Iba09924beb9fb26f597ff94d1cecbd6d6b1af912
diff --git a/include/multipart_parser.hpp b/include/multipart_parser.hpp
index e385558..ee028f1 100644
--- a/include/multipart_parser.hpp
+++ b/include/multipart_parser.hpp
@@ -337,10 +337,10 @@
static constexpr char hyphen = '-';
static constexpr char colon = ':';
- std::array<bool, 256> boundaryIndex;
+ std::array<bool, 256> boundaryIndex{};
std::string lookbehind;
- State state;
- Boundary flags;
+ State state{State::START};
+ Boundary flags{Boundary::NON_BOUNDARY};
size_t index = 0;
size_t partDataMark = 0;
size_t headerFieldMark = 0;
diff --git a/include/sessions.hpp b/include/sessions.hpp
index 79e71ce..b445915 100644
--- a/include/sessions.hpp
+++ b/include/sessions.hpp
@@ -46,7 +46,7 @@
std::string clientId;
std::string clientIp;
std::chrono::time_point<std::chrono::steady_clock> lastUpdated;
- PersistenceType persistence;
+ PersistenceType persistence{PersistenceType::TIMEOUT};
bool cookieAuth = false;
bool isConfigureSelfOnly = false;