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.

41 lines
1.5 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../make/0001-fix-memory-area-overlap.patch
  5. # Copyright (C) 2010 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. bug #27148: Use of strcpy on overlapping memory areas
  17. http://savannah.gnu.org/bugs/?27148
  18. http://cvs.savannah.gnu.org/viewvc/make/job.c?root=make&r1=1.194&r2=1.195
  19. 2009-08-01 Paul Smith <psmith@gnu.org>
  20. * job.c (new_job): Use memmove() instead of strcpy() since both
  21. pointers are in the same memory block. Fixes Savannah bug #27148.
  22. Patch by Petr Machata.
  23. diff --git a/job.c b/job.c
  24. index a81cd81..3251efe 100644
  25. --- a/job.c
  26. +++ b/job.c
  27. @@ -1594,7 +1594,7 @@ new_job (struct file *file)
  28. /* There are no more references in this line to worry about.
  29. Copy the remaining uninteresting text to the output. */
  30. if (out != in)
  31. - strcpy (out, in);
  32. + memmove (out, in, strlen (in) + 1);
  33. /* Finally, expand the line. */
  34. lines[i] = allocated_variable_expand_for_file (cmds->command_lines[i],
  35. --
  36. 1.6.5.3