cygwin: Fix crashes under AllocationPreference=0x100000 condition

* cygtls.h: Include cygtls_padsize.h and define CYGTLS_PADSIZE there.
        * cygtls_padsize.h: New file.  Define CYGTLS_PADSIZE.
        * environ.cc (parse_options): Fix NULL pointer access.
        * init.cc (threadfunc_fe): Do not force stack align on x86_64.

        * strace.cc (main2): Rename from main.
        (main): Make room for _cygtls area on stack and just call main2.  Add
        comment to explain why.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2015-07-29 13:32:29 +02:00
parent 9753bc3333
commit 6ab56bdd3f
8 changed files with 55 additions and 13 deletions

View File

@@ -232,8 +232,7 @@ parse_options (const char *inbuf)
switch (k->disposition)
{
case isfunc:
k->setting.func ((!eq || !istrue) ?
k->values[istrue].s : eq);
k->setting.func ((!eq || !istrue) ? k->values[istrue].s : eq);
debug_printf ("%s (called func)", k->name);
break;
case setdword:
@@ -258,10 +257,12 @@ parse_options (const char *inbuf)
break;
}
int n = 0;
if (eq)
*--eq = ch;
int n = eq - p;
{
*--eq = ch;
n = eq - p;
}
p = strdup (keyword_here);
if (n > 0)
p[n] = ':';