From 28b9971e83513075f3235bea0560ca5ac7f81499 Mon Sep 17 00:00:00 2001 From: rootvector2 Date: Tue, 9 Jun 2026 17:14:27 +0530 Subject: [PATCH] identfile: read original spoof with ReadFile Read() returned up to 1024 bytes into a stack buffer that was then assigned to a CString via the const char* overload, so strlen() walked past the end of buf when the file filled all 1024 bytes without a NUL. ReadFile() bounds the append by the byte count Read() returns and reads the whole file, so the original contents also round-trip faithfully. --- modules/identfile.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/identfile.cpp b/modules/identfile.cpp index 63700f5b..7ad55240 100644 --- a/modules/identfile.cpp +++ b/modules/identfile.cpp @@ -111,10 +111,7 @@ class CIdentFileModule : public CModule { return false; } - char buf[1024]; - memset((char*)buf, 0, 1024); - m_pISpoofLockFile->Read(buf, 1024); - m_sOrigISpoof = buf; + m_pISpoofLockFile->ReadFile(m_sOrigISpoof); if (!m_pISpoofLockFile->Seek(0) || !m_pISpoofLockFile->Truncate()) { delete m_pISpoofLockFile;