Do initLoader() properly, instead of relying on the amount of stack space

that is in use when ::buildLinuxLoader is called.

committer: jreiser <jreiser> 1131597922 +0000
This commit is contained in:
John Reiser 2005-11-10 04:45:22 +00:00
parent 5f77562333
commit f78e9261f3

View File

@ -273,8 +273,13 @@ PackLinuxElf32ppc::buildLinuxLoader(
Filter const */*ft*/
)
{
int eof_empty = -1;
initLoader(&eof_empty, 4096, 0, 0);
{
int const MAX_LOADER_LEN = 4096;
int *const eof_empty = new int[MAX_LOADER_LEN/sizeof(int)];
eof_empty[0] = -1;
initLoader(eof_empty, MAX_LOADER_LEN, 0, 0);
delete[] eof_empty;
}
struct b_info h; memset(&h, 0, sizeof(h));
unsigned fold_hdrlen = 0;
@ -325,8 +330,13 @@ PackLinuxElf64amd::buildLinuxLoader(
Filter const */*ft*/
)
{
int eof_empty = -1;
initLoader(&eof_empty, 9000, 0, 0);
{
int const MAX_LOADER_LEN = 8000;
int *const eof_empty = new int[MAX_LOADER_LEN/sizeof(int)];
eof_empty[0] = -1;
initLoader(eof_empty, MAX_LOADER_LEN, 0, 0);
delete[] eof_empty;
}
struct b_info h; memset(&h, 0, sizeof(h));
unsigned fold_hdrlen = 0;