From e30c9cee701d76476b5b081869dcf85a308cb6ee Mon Sep 17 00:00:00 2001 From: Nick Banks Date: Thu, 11 Aug 2022 10:07:31 -0400 Subject: [PATCH] Fix Uninitialized Headers Struct (#58) --- lib/msh3.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/msh3.hpp b/lib/msh3.hpp index ed8dece3..f114ae8a 100644 --- a/lib/msh3.hpp +++ b/lib/msh3.hpp @@ -52,6 +52,7 @@ enum H3SettingsType { // Contiguous buffer for (non-null-terminated) header name and value strings. struct H3HeadingPair : public lsxpack_header_t { char Buffer[512] = {0}; + H3HeadingPair() { memset(this, 0, sizeof(lsxpack_header_t)); } bool Set(const MSH3_HEADER* Header) { if (Header->NameLength + Header->ValueLength > sizeof(Buffer)) return false; buf = Buffer;