From 9531bdf6744b0cac4cfa7ec163af01efe51a9d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Moln=C3=A1r?= Date: Fri, 7 Jul 2006 16:57:15 +0200 Subject: [PATCH] fixed a bug in ElfLinker --- src/linker.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/linker.cpp b/src/linker.cpp index f26abf7c..9d62bdae 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -477,7 +477,7 @@ ElfLinker::~ElfLinker() void ElfLinker::init(const void *pdata, int plen, int) { - upx_byte *i = new upx_byte[plen]; + upx_byte *i = new upx_byte[plen + 1]; memcpy(i, pdata, plen); input = i; inputlen = plen; @@ -494,6 +494,7 @@ void ElfLinker::init(const void *pdata, int plen, int) char *prelocs = strstr(psymbols, "RELOCATION RECORDS FOR"); assert(prelocs != NULL); + input[plen] = 0; preprocessSections(psections, psymbols); preprocessSymbols(psymbols, prelocs);