* autoload.cc (std_dll_init): Move dll_path closer to its use. Use dll_path in
fatal error. Set ret values under lock control. * lib/minires.c (res_nsend): Fix compilation errors owing to pointer signedness.
This commit is contained in:
parent
7438a10a01
commit
8d07b1aa2b
|
@ -1,3 +1,10 @@
|
||||||
|
2010-09-24 Christopher Faylor <me+cygwin@cgf.cx>
|
||||||
|
|
||||||
|
* autoload.cc (std_dll_init): Move dll_path closer to its use. Use
|
||||||
|
dll_path in fatal error. Set ret values under lock control.
|
||||||
|
* lib/minires.c (res_nsend): Fix compilation errors owing to pointer
|
||||||
|
signedness.
|
||||||
|
|
||||||
2010-09-24 Corinna Vinschen <corinna@vinschen.de>
|
2010-09-24 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler.cc (fhandler_base::open): Handle query_write_dac flag.
|
* fhandler.cc (fhandler_base::open): Handle query_write_dac flag.
|
||||||
|
|
|
@ -212,7 +212,6 @@ std_dll_init ()
|
||||||
struct func_info *func = (struct func_info *) __builtin_return_address (0);
|
struct func_info *func = (struct func_info *) __builtin_return_address (0);
|
||||||
struct dll_info *dll = func->dll;
|
struct dll_info *dll = func->dll;
|
||||||
retchain ret;
|
retchain ret;
|
||||||
WCHAR dll_path[MAX_PATH];
|
|
||||||
|
|
||||||
if (InterlockedIncrement (&dll->here))
|
if (InterlockedIncrement (&dll->here))
|
||||||
do
|
do
|
||||||
|
@ -225,6 +224,7 @@ std_dll_init ()
|
||||||
{
|
{
|
||||||
fenv_t fpuenv;
|
fenv_t fpuenv;
|
||||||
fegetenv (&fpuenv);
|
fegetenv (&fpuenv);
|
||||||
|
WCHAR dll_path[MAX_PATH];
|
||||||
/* http://www.microsoft.com/technet/security/advisory/2269637.mspx */
|
/* http://www.microsoft.com/technet/security/advisory/2269637.mspx */
|
||||||
wcpcpy (wcpcpy (dll_path, windows_system_directory), dll->name);
|
wcpcpy (wcpcpy (dll_path, windows_system_directory), dll->name);
|
||||||
if ((h = LoadLibraryW (dll_path)) != NULL)
|
if ((h = LoadLibraryW (dll_path)) != NULL)
|
||||||
|
@ -233,11 +233,15 @@ std_dll_init ()
|
||||||
dll->handle = h;
|
dll->handle = h;
|
||||||
}
|
}
|
||||||
else if (!(func->decoration & 1))
|
else if (!(func->decoration & 1))
|
||||||
api_fatal ("could not load %W, %E", dll->name);
|
api_fatal ("could not load %W, %E", dll_path);
|
||||||
else
|
else
|
||||||
dll->handle = INVALID_HANDLE_VALUE;
|
dll->handle = INVALID_HANDLE_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set "arguments for dll_chain. */
|
||||||
|
ret.low = (long) dll->init;
|
||||||
|
ret.high = (long) func;
|
||||||
|
|
||||||
InterlockedDecrement (&dll->here);
|
InterlockedDecrement (&dll->here);
|
||||||
|
|
||||||
/* Kludge alert. Redirects the return address to dll_chain. */
|
/* Kludge alert. Redirects the return address to dll_chain. */
|
||||||
|
@ -245,9 +249,6 @@ std_dll_init ()
|
||||||
movl $dll_chain,4(%ebp) \n\
|
movl $dll_chain,4(%ebp) \n\
|
||||||
");
|
");
|
||||||
|
|
||||||
/* Set "arguments for dll_chain. */
|
|
||||||
ret.low = (long) dll->init;
|
|
||||||
ret.high = (long) func;
|
|
||||||
return ret.ll;
|
return ret.ll;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -441,8 +441,8 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr,
|
||||||
if (statp->os_query) {
|
if (statp->os_query) {
|
||||||
int len;
|
int len;
|
||||||
short int Class, Type;
|
short int Class, Type;
|
||||||
unsigned char DomName[MAXDNAME];
|
char DomName[MAXDNAME];
|
||||||
unsigned char * ptr = MsgPtr + HFIXEDSZ;
|
unsigned char * ptr = (unsigned char *) MsgPtr + HFIXEDSZ;
|
||||||
len = dn_expand(MsgPtr, MsgPtr + MsgLength, ptr, DomName, sizeof(DomName));
|
len = dn_expand(MsgPtr, MsgPtr + MsgLength, ptr, DomName, sizeof(DomName));
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
ptr += len;
|
ptr += len;
|
||||||
|
|
Loading…
Reference in New Issue