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:
John Reiser
2022-10-04 13:01:08 -07:00
committed by Markus F.X.J. Oberhumer
parent f67cec4752
commit 05ff7e35a1
4 changed files with 92 additions and 80 deletions
+5
View File
@@ -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;
}
}