* net.cc (dup_ent): Move Win 95 misalignment recogition before
trying to evaluate string length.
This commit is contained in:
parent
79c5244017
commit
dff017b292
@ -1,3 +1,8 @@
|
|||||||
|
2003-11-03 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* net.cc (dup_ent): Move Win 95 misalignment recogition before
|
||||||
|
trying to evaluate string length.
|
||||||
|
|
||||||
2003-10-31 Thomas Pfaff <tpfaff@gmx.net>
|
2003-10-31 Thomas Pfaff <tpfaff@gmx.net>
|
||||||
|
|
||||||
* thread.cc (pthread::thread_init_wrapper): Initialize exception
|
* thread.cc (pthread::thread_init_wrapper): Initialize exception
|
||||||
|
@ -499,8 +499,21 @@ dup_ent (void *old, void *src0, struct_type type)
|
|||||||
/* Do servent/hostent specific processing */
|
/* Do servent/hostent specific processing */
|
||||||
int protolen = 0;
|
int protolen = 0;
|
||||||
int addr_list_len = 0;
|
int addr_list_len = 0;
|
||||||
|
char *s_proto = NULL;
|
||||||
if (type == is_servent)
|
if (type == is_servent)
|
||||||
sz += (protolen = strlen_round (src->s_proto));
|
{
|
||||||
|
if (src->s_proto)
|
||||||
|
{
|
||||||
|
/* Windows 95 idiocy. Structure is misaligned on Windows 95.
|
||||||
|
Kludge around this by trying a different pointer alignment. */
|
||||||
|
if (IsBadReadPtr (src->s_proto, sizeof (src->s_proto))
|
||||||
|
&& !IsBadReadPtr (((pservent *) src)->s_proto, sizeof (src->s_proto)))
|
||||||
|
s_proto = ((pservent *) src)->s_proto;
|
||||||
|
else
|
||||||
|
s_proto = src->s_proto;
|
||||||
|
}
|
||||||
|
sz += (protolen = strlen_round (s_proto));
|
||||||
|
}
|
||||||
else if (type == is_hostent)
|
else if (type == is_hostent)
|
||||||
{
|
{
|
||||||
/* Calculate the length and storage used for h_addr_list */
|
/* Calculate the length and storage used for h_addr_list */
|
||||||
@ -549,16 +562,8 @@ dup_ent (void *old, void *src0, struct_type type)
|
|||||||
/* Do servent/hostent specific processing. */
|
/* Do servent/hostent specific processing. */
|
||||||
if (type == is_servent)
|
if (type == is_servent)
|
||||||
{
|
{
|
||||||
if (src->s_proto)
|
if (s_proto)
|
||||||
{
|
{
|
||||||
char *s_proto;
|
|
||||||
/* Windows 95 idiocy. Structure is misaligned on Windows 95.
|
|
||||||
Kludge around this by trying a different pointer alignment. */
|
|
||||||
if (IsBadReadPtr (src->s_proto, sizeof (src->s_proto))
|
|
||||||
&& !IsBadReadPtr (((pservent *) src)->s_proto, sizeof (src->s_proto)))
|
|
||||||
s_proto = ((pservent *) src)->s_proto;
|
|
||||||
else
|
|
||||||
s_proto = src->s_proto;
|
|
||||||
strcpy (dst->s_proto = dp, s_proto);
|
strcpy (dst->s_proto = dp, s_proto);
|
||||||
dp += protolen;
|
dp += protolen;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user