]> Dogcows Code - chaz/tar/commit
tar: don't cross struct member boundaries with OLDGNU_MAGIC
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 28 Oct 2010 05:25:18 +0000 (22:25 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 28 Oct 2010 05:31:16 +0000 (22:31 -0700)
commitb8feb2b14247d76200fd53607d3613c82b6e5b81
tree1a4285963b922162562929c82b9e0b8b357e153d
parent3fe59ed5ef44d61d313e711b8920f8285792d3b2
tar: don't cross struct member boundaries with OLDGNU_MAGIC

* src/create.c (write_gnu_long_link, start_header): Access
header->buffer + offsetof (struct posix_header, magic), instead of
header->header.magic, when reading or writing the OLDGNU_MAGIC
pattern.  The code violates the C standard without this change,
and GCC warns about this if fortify checking is enabled.  It's not
a bug on traditional (i.e., non-debugging) platforms, but it does
violate the C standard so it should be fixed.  Problem originally
reported by John Emil Karlson in
<http://lists.gnu.org/archive/html/bug-tar/2010-04/msg00023.html>.
* src/list.c (decode_header): Likewise.
src/create.c
src/list.c
This page took 0.021925 seconds and 4 git commands to generate.