mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Avoid sigsegv after "patchelf --set-rpath"
https://github.com/upx/upx/issues/47 Enhancement not yet implemented: non-adjacent ElfXX_Ehdr and ElfXX_Phdr. modified: p_unix.cpp
This commit is contained in:
parent
cdc01d9a69
commit
90fc018295
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer
|
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer
|
||||||
Copyright (C) 1996-2017 Laszlo Molnar
|
Copyright (C) 1996-2017 Laszlo Molnar
|
||||||
|
Copyright (C) 2000-2017 John F. Reiser
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
UPX and the UCL library are free software; you can redistribute them
|
UPX and the UCL library are free software; you can redistribute them
|
||||||
|
@ -23,6 +24,9 @@
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer Laszlo Molnar
|
Markus F.X.J. Oberhumer Laszlo Molnar
|
||||||
<markus@oberhumer.com> <ezerotven+github@gmail.com>
|
<markus@oberhumer.com> <ezerotven+github@gmail.com>
|
||||||
|
|
||||||
|
John F. Reiser
|
||||||
|
<jreiser@users.sourceforge.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -242,8 +246,14 @@ PackUnix::patchLoaderChecksum()
|
||||||
set_te32(&lp->l_checksum, upx_adler32(ptr, lsize));
|
set_te32(&lp->l_checksum, upx_adler32(ptr, lsize));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackUnix::pack3(OutputFile *fo, Filter &/*ft*/)
|
void PackUnix::pack3(OutputFile *fo, Filter &ft)
|
||||||
{
|
{
|
||||||
|
if (0==linker) {
|
||||||
|
// If no filter, then linker is not constructed by side effect
|
||||||
|
// of packExtent calling compressWithFilters.
|
||||||
|
// This is typical after "/usr/bin/patchelf --set-rpath".
|
||||||
|
buildLoader(&ft);
|
||||||
|
}
|
||||||
upx_byte *p = getLoader();
|
upx_byte *p = getLoader();
|
||||||
lsize = getLoaderSize();
|
lsize = getLoaderSize();
|
||||||
updateLoader(fo);
|
updateLoader(fo);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user