Warn for big shell scripts, and send them to --force-execve.
Also propagte error code when execve() fails for compressed shell, to avoid confusion of `hlt` ==> SIGSEGV. https://github.com/upx/upx/issues/604
This commit is contained in:
committed by
Markus F.X.J. Oberhumer
parent
f67cec4752
commit
05ff7e35a1
@@ -126,6 +126,11 @@ bool PackLinuxI386sh::getShellName(char *buf)
|
||||
if (s) {
|
||||
opt->o_unix.blocksize = blocksize = file_size;
|
||||
}
|
||||
unsigned size = fi->st_size();
|
||||
if (size > (125<<10)) { // 128KB but allow 3KB for environment
|
||||
printWarn(fi->getName(), "Likely E2BIG for size=%u", size);
|
||||
return false;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user