* net.cc (dup_ent): Use IsBadStringPtr for alignment checks. Don't use a known

bad pointer.
This commit is contained in:
Christopher Faylor 2003-11-04 13:15:47 +00:00
parent 02bd05e386
commit c35391d0d2
2 changed files with 9 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2003-11-04 Christopher Faylor <cgf@redhat.com>
* net.cc (dup_ent): Use IsBadStringPtr for alignment checks. Don't use
a known bad pointer.
2003-11-03 Corinna Vinschen <corinna@vinschen.de>
* net.cc (dup_ent): Move Win 95 misalignment recogition before

View File

@ -506,13 +506,12 @@ dup_ent (void *old, void *src0, struct_type type)
{
/* 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
if (!IsBadStringPtr (src->s_proto, 0x7fffffff))
s_proto = src->s_proto;
else if (!IsBadStringPtr (((pservent *) src)->s_proto, 0x7fffffff))
s_proto = ((pservent *) src)->s_proto;
sz += (protolen = strlen_round (s_proto));
}
sz += (protolen = strlen_round (s_proto));
}
else if (type == is_hostent)
{