* dcrt0.cc (_dcrt0): Be more defensive when reserved block is used and it's not

cygwin info.
This commit is contained in:
Christopher Faylor 2002-06-26 05:37:29 +00:00
parent f279e522b0
commit 8698edb8ae
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2002-06-26 Christopher Faylor <cgf@redhat.com>
* dcrt0.cc (_dcrt0): Be more defensive when reserved block is used and
it's not cygwin info.
2002-06-26 Christopher Faylor <cgf@redhat.com>
* autoload (noload): Avoid clobbering bx register.

View File

@ -821,8 +821,10 @@ _dll_crt0 ()
GetStartupInfo (&si);
child_proc_info = (child_info *) si.lpReserved2;
if (si.cbReserved2 >= EXEC_MAGIC_SIZE &&
memcmp (child_proc_info->zero, zeros, sizeof (zeros)) == 0)
if (si.cbReserved2 < EXEC_MAGIC_SIZE || !child_proc_info
|| memcmp (child_proc_info->zero, zeros, sizeof (zeros)) != 0)
child_proc_info = NULL;
else
{
if ((child_proc_info->intro & OPROC_MAGIC_MASK) == OPROC_MAGIC_GENERIC)
multiple_cygwin_problem ("proc", child_proc_info->intro, 0);