diffutils-3.4-diff3_use_after_free.patch 750 B

123456789101112131415161718192021222324252627
  1. From 1a0df4396ebe3b9a58b882bb976cfce3f50d3cac Mon Sep 17 00:00:00 2001
  2. From: Bastian Beischer <bastian.beischer@rwth-aachen.de>
  3. Date: Sat, 13 Aug 2016 18:53:36 -0700
  4. Subject: diff3: fix heap use-after-free; add minimal diff3 test coverage
  5. Commit v3.3-42-g3b74a90, "FIXME: src/diff3: plug a leak" added an
  6. invalid use of free, leading to use-after-free in nearly any invocation
  7. of diff3. Revert that commit.
  8. Reported by Bastian Beischer in http://bugs.gnu.org/24210
  9. ---
  10. diff --git a/src/diff3.c b/src/diff3.c
  11. index 6ef90f4..0eb643e 100644
  12. --- a/src/diff3.c
  13. +++ b/src/diff3.c
  14. @@ -1039,7 +1039,6 @@ process_diff (char const *filea,
  15. *block_list_end = NULL;
  16. *last_block = bptr;
  17. - free (diff_contents);
  18. return block_list;
  19. }
  20. --
  21. cgit v1.0