cve-2014-6277.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. bash: Fix CVE-2014-6277 (shellshock)
  2. Upstream-status: backport
  3. Downloaded from:
  4. ftp://ftp.gnu.org/pub/bash/bash-4.3-patches/bash43-029
  5. Author: Chet Ramey <chet.ramey@case.edu>
  6. Signed-off-by: Catalin Popeanga <catalin.popeanga@enea.com>
  7. BASH PATCH REPORT
  8. =================
  9. Bash-Release: 4.3
  10. Patch-ID: bash43-029
  11. Bug-Reported-by: Michal Zalewski <lcamtuf@coredump.cx>
  12. Bug-Reference-ID:
  13. Bug-Reference-URL:
  14. Bug-Description:
  15. When bash is parsing a function definition that contains a here-document
  16. delimited by end-of-file (or end-of-string), it leaves the closing delimiter
  17. uninitialized. This can result in an invalid memory access when the parsed
  18. function is later copied.
  19. ---
  20. --- a/make_cmd.c 2011-12-16 08:08:01.000000000 -0500
  21. +++ b/make_cmd.c 2014-10-02 11:24:23.000000000 -0400
  22. @@ -693,4 +693,5 @@
  23. temp->redirector = source;
  24. temp->redirectee = dest_and_filename;
  25. + temp->here_doc_eof = 0;
  26. temp->instruction = instruction;
  27. temp->flags = 0;
  28. --- a/copy_cmd.c 2009-09-11 16:28:02.000000000 -0400
  29. +++ b/copy_cmd.c 2014-10-02 11:24:23.000000000 -0400
  30. @@ -127,5 +127,5 @@
  31. case r_reading_until:
  32. case r_deblank_reading_until:
  33. - new_redirect->here_doc_eof = savestring (redirect->here_doc_eof);
  34. + new_redirect->here_doc_eof = redirect->here_doc_eof ? savestring (redirect->here_doc_eof) : 0;
  35. /*FALLTHROUGH*/
  36. case r_reading_string: