diff options
author | Christopher Faylor <me@cgf.cx> | 2003-11-04 16:15:47 +0300 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-11-04 16:15:47 +0300 |
commit | c35391d0d2b0c5fd057aa1ccd4c215a0082919d5 (patch) | |
tree | ea6825034113709a64ddd4833b0e4c10f08e9527 /winsup/cygwin/net.cc | |
parent | 02bd05e386e9bac85d8c06125c2c90e1ebffa7f4 (diff) |
* net.cc (dup_ent): Use IsBadStringPtr for alignment checks. Don't use a known
bad pointer.
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r-- | winsup/cygwin/net.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index f956cbd8f..835885b12 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -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) { |