|
|
1d932a |
BASH PATCH REPORT
|
|
|
1d932a |
=================
|
|
|
1d932a |
|
|
|
1d932a |
Bash-Release: 4.2
|
|
|
1d932a |
Patch-ID: bash42-052
|
|
|
1d932a |
|
|
|
1d932a |
Bug-Reported-by: Michal Zalewski <lcamtuf@coredump.cx>
|
|
|
1d932a |
Bug-Reference-ID:
|
|
|
1d932a |
Bug-Reference-URL:
|
|
|
1d932a |
|
|
|
1d932a |
Bug-Description:
|
|
|
1d932a |
|
|
|
1d932a |
When bash is parsing a function definition that contains a here-document
|
|
|
1d932a |
delimited by end-of-file (or end-of-string), it leaves the closing delimiter
|
|
|
1d932a |
uninitialized. This can result in an invalid memory access when the parsed
|
|
|
1d932a |
function is later copied.
|
|
|
1d932a |
|
|
|
1d932a |
Patch (apply with `patch -p0'):
|
|
|
1d932a |
|
|
|
1d932a |
*** ../bash-4.2.51/make_cmd.c 2009-09-11 17:26:12.000000000 -0400
|
|
|
1d932a |
--- make_cmd.c 2014-10-02 11:26:58.000000000 -0400
|
|
|
1d932a |
***************
|
|
|
1d932a |
*** 690,693 ****
|
|
|
1d932a |
--- 690,694 ----
|
|
|
1d932a |
temp->redirector = source;
|
|
|
1d932a |
temp->redirectee = dest_and_filename;
|
|
|
1d932a |
+ temp->here_doc_eof = 0;
|
|
|
1d932a |
temp->instruction = instruction;
|
|
|
1d932a |
temp->flags = 0;
|
|
|
1d932a |
*** ../bash-4.2.51/copy_cmd.c 2009-09-11 16:28:02.000000000 -0400
|
|
|
1d932a |
--- copy_cmd.c 2014-10-02 11:26:58.000000000 -0400
|
|
|
1d932a |
***************
|
|
|
1d932a |
*** 127,131 ****
|
|
|
1d932a |
case r_reading_until:
|
|
|
1d932a |
case r_deblank_reading_until:
|
|
|
1d932a |
! new_redirect->here_doc_eof = savestring (redirect->here_doc_eof);
|
|
|
1d932a |
/*FALLTHROUGH*/
|
|
|
1d932a |
case r_reading_string:
|
|
|
1d932a |
--- 127,131 ----
|
|
|
1d932a |
case r_reading_until:
|
|
|
1d932a |
case r_deblank_reading_until:
|
|
|
1d932a |
! new_redirect->here_doc_eof = redirect->here_doc_eof ? savestring (redirect->here_doc_eof) : 0;
|
|
|
1d932a |
/*FALLTHROUGH*/
|
|
|
1d932a |
case r_reading_string:
|