fixed a bug in ElfLinker
This commit is contained in:
+2
-1
@@ -477,7 +477,7 @@ ElfLinker::~ElfLinker()
|
|||||||
|
|
||||||
void ElfLinker::init(const void *pdata, int plen, int)
|
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);
|
memcpy(i, pdata, plen);
|
||||||
input = i;
|
input = i;
|
||||||
inputlen = plen;
|
inputlen = plen;
|
||||||
@@ -494,6 +494,7 @@ void ElfLinker::init(const void *pdata, int plen, int)
|
|||||||
|
|
||||||
char *prelocs = strstr(psymbols, "RELOCATION RECORDS FOR");
|
char *prelocs = strstr(psymbols, "RELOCATION RECORDS FOR");
|
||||||
assert(prelocs != NULL);
|
assert(prelocs != NULL);
|
||||||
|
input[plen] = 0;
|
||||||
|
|
||||||
preprocessSections(psections, psymbols);
|
preprocessSections(psections, psymbols);
|
||||||
preprocessSymbols(psymbols, prelocs);
|
preprocessSymbols(psymbols, prelocs);
|
||||||
|
|||||||
Reference in New Issue
Block a user