sort -m: don't segfault when output file is also an input file
commit25eb4c69097ca4f5665b050cfa4247a19ffd8c55
authorJim Meyering <meyering@redhat.com>
Wed, 22 Apr 2009 06:45:27 +0000 (22 08:45 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 23 Apr 2009 19:03:14 +0000 (23 21:03 +0200)
tree0b17c83b2d096a6c3a0fd9bb15322fdbf25af46e
parentf41f926aab38d52734b3908eeb0496ebf1285cbd
sort -m: don't segfault when output file is also an input file

* src/sort.c (avoid_trashing_input): Fix an off-by-one error and
guard the use of memmove.
* NEWS (Bug fixes): Mention it.
* tests/misc/sort: Add tests to exercise the offending code.
* THANKS: Update.
Reported by Otavio Salvador in http://bugs.debian.org/525048.
NEWS
THANKS
src/sort.c
tests/misc/sort