From 9d2ffa6e26f9b0036e771f6befabe4442478b5f7 Mon Sep 17 00:00:00 2001 From: rexx <67599507+r-ex@users.noreply.github.com> Date: Sat, 14 Jan 2023 15:35:46 +0000 Subject: [PATCH] bansystem: fix incorrect allocation size causing OOB memory write --- r5dev/networksystem/bansystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r5dev/networksystem/bansystem.cpp b/r5dev/networksystem/bansystem.cpp index aa0f9f7d..12088126 100644 --- a/r5dev/networksystem/bansystem.cpp +++ b/r5dev/networksystem/bansystem.cpp @@ -24,7 +24,7 @@ void CBanSystem::Load(void) return; uint32_t nLen = FileSystem()->Size(pFile); - char* pBuf = MemAllocSingleton()->Alloc(nLen); + char* pBuf = MemAllocSingleton()->Alloc(nLen + 1); int nRead = FileSystem()->Read(pBuf, nLen, pFile); FileSystem()->Close(pFile);