1
0

129-upstream-bash43-029.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 4.3
  4. Patch-ID: bash43-029
  5. Bug-Reported-by: Michal Zalewski <lcamtuf@coredump.cx>
  6. Bug-Reference-ID:
  7. Bug-Reference-URL:
  8. Bug-Description:
  9. When bash is parsing a function definition that contains a here-document
  10. delimited by end-of-file (or end-of-string), it leaves the closing delimiter
  11. uninitialized. This can result in an invalid memory access when the parsed
  12. function is later copied.
  13. Patch (apply with `patch -p0'):
  14. --- a/make_cmd.c
  15. +++ b/make_cmd.c
  16. @@ -692,6 +692,7 @@ make_redirection (source, instruction, d
  17. /* First do the common cases. */
  18. temp->redirector = source;
  19. temp->redirectee = dest_and_filename;
  20. + temp->here_doc_eof = 0;
  21. temp->instruction = instruction;
  22. temp->flags = 0;
  23. temp->rflags = flags;
  24. --- a/copy_cmd.c
  25. +++ b/copy_cmd.c
  26. @@ -126,7 +126,7 @@ copy_redirect (redirect)
  27. {
  28. case r_reading_until:
  29. case r_deblank_reading_until:
  30. - new_redirect->here_doc_eof = savestring (redirect->here_doc_eof);
  31. + new_redirect->here_doc_eof = redirect->here_doc_eof ? savestring (redirect->here_doc_eof) : 0;
  32. /*FALLTHROUGH*/
  33. case r_reading_string:
  34. case r_appending_to:
  35. --- a/patchlevel.h
  36. +++ b/patchlevel.h
  37. @@ -25,6 +25,6 @@
  38. regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
  39. looks for to find the patch level (for the sccs version string). */
  40. -#define PATCHLEVEL 28
  41. +#define PATCHLEVEL 29
  42. #endif /* _PATCHLEVEL_H_ */