From a5364600673c7a5aa5f398d8938ea76d398ec990 Mon Sep 17 00:00:00 2001 From: nakeee Date: Wed, 17 Jun 2009 22:16:48 +0000 Subject: [PATCH] Fixed buffer overflow in CodesToHeader, now dsptool -m creates files correctly as far as I could test git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3484 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DSPCore/Src/DSPCodeUtil.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Core/DSPCore/Src/DSPCodeUtil.cpp b/Source/Core/DSPCore/Src/DSPCodeUtil.cpp index e41866e414..709ecfc095 100644 --- a/Source/Core/DSPCore/Src/DSPCodeUtil.cpp +++ b/Source/Core/DSPCore/Src/DSPCodeUtil.cpp @@ -150,7 +150,7 @@ void CodeToHeader(const std::vector &code, std::string _filename, void CodesToHeader(const std::vector *codes, const std::vector* filenames, int numCodes, const char *name, std::string &header) { - char buffer[1024]; + char buffer[0x1000]; int reserveSize = 0; for(int i = 0; i < numCodes; i++) reserveSize += (int)codes[i].size(); @@ -165,7 +165,6 @@ void CodesToHeader(const std::vector *codes, const std::vector { std::string filename; SplitPath(filenames->at(i), NULL, &filename, NULL); - // printf("files %s\n", (filenames->at(i).c_str())); sprintf(buffer, "%s\t\"%s\",\n", buffer, filename.c_str()); } sprintf(buffer, "%s};\n\n", buffer);