nalika / rpms / bash

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