glibc/inet
Mike Frysinger abb66a672f tftp.h: rework layout to work with fortification
The current tftp structure does not work when fortification is enabled.
Starting with gcc-4.5, more size checking was added to trigger these.
Older versions just didn't have enough information, so they returned -1
as the sizes.

First, the tu_stuff field is declared as 1 byte (when it's really an
arbitrary length C string), so attempting to strcpy() with it results
in crashes.  This fails with _FORTIFY_SOURCE=1.

Second, even if we change that to [0] (since gcc does not allow flexible
array members in an union), gcc is not smart enough to see that they are
two overlapping flexible arrays (tu_stuff and tu_data), so it will still
trigger an abort with _FORTIFY_SOURCE=2.  This is because it thinks that
tu_stuff is 0 bytes and tu_data comes after it.

Talking to upstream gcc, they don't seem terribly inclined to fix the
2nd issue, but even if they did, we still have plenty of 4.5 and 4.6
installs that would hit problems.

So, let's re-order with a few more anonymous structs & unions so that
the fields are laid out with a zero-length array always as the last
field.  This seems to fix things with gcc-4.6, and the tftp-hpa pkg
continues to build & work.

URL: https://bugs.launchpad.net/ubuntu/+source/tftp-hpa/+bug/691345
URL: https://bugs.archlinux.org/task/28103
URL: https://bugs.gentoo.org/357083
URL: http://gcc.gnu.org/PR52944
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-05-08 01:51:22 -04:00
..
arpa tftp.h: rework layout to work with fortification 2012-05-08 01:51:22 -04:00
netinet Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
protocols Don't use removed rpc headers 2011-05-05 07:36:40 -04:00
aliases.h Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
bug-if1.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
check_pf.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
ether_aton.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
ether_aton_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
ether_hton.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
ether_line.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
ether_ntoa.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
ether_ntoa_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
ether_ntoh.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getaliasent.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getaliasent_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getaliasname.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getaliasname_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
gethstbyad.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
gethstbyad_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
gethstbynm.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
gethstbynm2.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
gethstbynm2_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
gethstbynm_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
gethstent.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
gethstent_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getipv4sourcefilter.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getnameinfo.c Fix error code for too small input buffer to getnameinfo 2011-12-22 19:21:36 -05:00
getnetbyad.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getnetbyad_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getnetbynm.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getnetbynm_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getnetent.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getnetent_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getnetgrent.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getnetgrent_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getproto.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getproto_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getprtent.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getprtent_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getprtname.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getprtname_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getrpcbyname.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getrpcbyname_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getrpcbynumber.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getrpcbynumber_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getrpcent.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getrpcent_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getservent.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getservent_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getsourcefilter.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getsrvbynm.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getsrvbynm_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getsrvbypt.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
getsrvbypt_r.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
herrno-loc.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
herrno.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
htonl.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
htons.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
htontest.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
if_index.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
ifaddrs.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
ifaddrs.h Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
ifreq.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
in6_addr.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
inet6_opt.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
inet6_option.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
inet6_rth.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
inet_lnaof.c
inet_mkadr.c
inet_net.c
inet_netof.c
inet_ntoa.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
Makefile 2012-03-23 Daniel Jacobowitz <dmj@google.com> 2012-03-23 09:47:03 -07:00
netgroup.h Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
rcmd.c Clean up internal fopen uses 2011-11-15 04:24:42 -05:00
rexec.c
ruserpass.c Clean up internal fopen uses 2011-11-15 04:24:42 -05:00
setipv4sourcefilter.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
setsourcefilter.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
test-ifaddrs.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
test-inet6_opt.c
test_ifindex.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
tst-checks.c Fix more warnings 2011-12-03 21:49:35 -05:00
tst-ether_aton.c
tst-ether_line.c
tst-gethnm.c
tst-getni1.c
tst-getni2.c
tst-inet6_rth.c
tst-network.c Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
tst-ntoa.c
Versions