diff options
author | Christopher Faylor <me@cgf.cx> | 2002-06-26 09:37:29 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-06-26 09:37:29 +0400 |
commit | 8698edb8ae42650a5222a2209b23ad513834b5e5 (patch) | |
tree | a9b8583498d582a7e23a342684afa436218d7417 /winsup | |
parent | f279e522b05950655c6b4699ecd7a7f115261bc8 (diff) |
* dcrt0.cc (_dcrt0): Be more defensive when reserved block is used and it's not
cygwin info.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 330ef3aab..9fe94d0ea 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 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. * environ.cc (codepage_init): Use case insensitive match. diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index f5fef08aa..da2865112 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -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); |