* net.cc (dup_ent): Use IsBadStringPtr for alignment checks. Don't use a known
bad pointer.
This commit is contained in:
parent
02bd05e386
commit
c35391d0d2
@ -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>
|
2003-11-03 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* net.cc (dup_ent): Move Win 95 misalignment recogition before
|
* net.cc (dup_ent): Move Win 95 misalignment recogition before
|
||||||
|
@ -506,13 +506,12 @@ dup_ent (void *old, void *src0, struct_type type)
|
|||||||
{
|
{
|
||||||
/* Windows 95 idiocy. Structure is misaligned on Windows 95.
|
/* Windows 95 idiocy. Structure is misaligned on Windows 95.
|
||||||
Kludge around this by trying a different pointer alignment. */
|
Kludge around this by trying a different pointer alignment. */
|
||||||
if (IsBadReadPtr (src->s_proto, sizeof (src->s_proto))
|
if (!IsBadStringPtr (src->s_proto, 0x7fffffff))
|
||||||
&& !IsBadReadPtr (((pservent *) src)->s_proto, sizeof (src->s_proto)))
|
|
||||||
s_proto = ((pservent *) src)->s_proto;
|
|
||||||
else
|
|
||||||
s_proto = src->s_proto;
|
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)
|
else if (type == is_hostent)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user