* dll_init.h (struct dll): Set size of name element to ANYSIZE_ARRAY.

* dll_init.cc: Fix formatting.
	(dll_list::alloc): Only allocate as much memory for struct dll as
	necessary for given DLL name.
	(dll_list::load_after_fork): Only read a single page of parent memory.
	Only read more if namelen indicates that it's necessary.
This commit is contained in:
Corinna Vinschen
2009-06-06 11:47:29 +00:00
parent 611fe46079
commit 1d95e198c1
3 changed files with 60 additions and 36 deletions

View File

@@ -1,6 +1,7 @@
/* dll_init.h
Copyright 1998, 1999, 2000, 2001 Red Hat, Inc.
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2008,
2009 Red Hat, Inc.
This file is part of Cygwin.
@@ -51,7 +52,7 @@ struct dll
int count;
dll_type type;
int namelen;
WCHAR name[NT_MAX_PATH];
WCHAR name[ANYSIZE_ARRAY];
void detach ();
int init ();
};