From e2968a43de90fd539eec3e4a9fdedc98ca84bb39 Mon Sep 17 00:00:00 2001 From: binarymaster Date: Tue, 9 Dec 2014 02:00:43 +0300 Subject: [PATCH] Do not forget about security --- src-x86-x64-Fusix/IniFile.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src-x86-x64-Fusix/IniFile.cpp b/src-x86-x64-Fusix/IniFile.cpp index 7758bfd..299247d 100644 --- a/src-x86-x64-Fusix/IniFile.cpp +++ b/src-x86-x64-Fusix/IniFile.cpp @@ -370,6 +370,8 @@ bool INI_FILE::GetVariableInSection(char *SectionName, char *VariableName, INI_V DWORD ValueLen = strlen(Variable.VariableValue); if((ValueLen % 2) != 0) return false; + // for security reasons not more than 16 bytes + if (ValueLen > 32) ValueLen = 32; // 32 hex digits memset(RetVariable, 0x00, sizeof(*RetVariable)); memcpy(RetVariable->Name, Variable.VariableName, ValueLen);