OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.4 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../musl/0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch
  5. # Copyright (C) 2016 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. From 9543656cc32fda48fc463f332ee20e91eed2b768 Mon Sep 17 00:00:00 2001
  17. From: Alexander Monakov <amonakov@ispras.ru>
  18. Date: Sun, 6 Mar 2016 20:22:38 +0300
  19. Subject: [PATCH] env: avoid leaving dangling pointers in __env_map
  20. This is the minimal fix for __putenv leaving a pointer to freed heap
  21. storage in __env_map array, which could later on lead to errors such
  22. as double-free.
  23. ---
  24. src/env/putenv.c | 1 +
  25. 1 file changed, 1 insertion(+)
  26. diff --git a/src/env/putenv.c b/src/env/putenv.c
  27. index 4042869..7153042 100644
  28. --- a/src/env/putenv.c
  29. +++ b/src/env/putenv.c
  30. @@ -30,6 +30,7 @@ int __putenv(char *s, int a)
  31. }
  32. } else {
  33. free(__env_map[j]);
  34. + __env_map[j] = s;
  35. }
  36. }
  37. }
  38. --
  39. 2.7.2