diff options
Diffstat (limited to 'actionpack-CVE-2012-1098-safe-buffer-slice.patch')
-rw-r--r-- | actionpack-CVE-2012-1098-safe-buffer-slice.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/actionpack-CVE-2012-1098-safe-buffer-slice.patch b/actionpack-CVE-2012-1098-safe-buffer-slice.patch new file mode 100644 index 0000000..3eaca8d --- /dev/null +++ b/actionpack-CVE-2012-1098-safe-buffer-slice.patch @@ -0,0 +1,44 @@ +From 00e632de2bde61425142ef8edc408e8d21ff9134 Mon Sep 17 00:00:00 2001 +From: Aaron Patterson <aaron.patterson@gmail.com> +Date: Wed, 29 Feb 2012 16:37:30 -0800 +Subject: [PATCH] Squashed commit of the following: +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit 917fd1a03845f4eedaccbc338f9d7524e98d45ee +Author: José Valim <jose.valim@gmail.com> +Date: Wed Feb 29 22:30:51 2012 +0100 + + Ensure [] respects the status of the buffer. + +commit 6adc41789017682306181e3db5b30337fe450bcc +Author: Akira Matsuda <ronnie@dio.jp> +Date: Mon Feb 13 17:57:05 2012 +0900 + + use AS::SafeBuffer#clone_empty for flushing the output_buffer + +commit e50ee96a0b37e7c5adfc555edd402ad04cc159f1 +Author: Akira Matsuda <ronnie@dio.jp> +Date: Mon Feb 13 17:54:58 2012 +0900 + + add AS::SafeBuffer#clone_empty +--- + .../lib/action_view/helpers/capture_helper.rb | 2 +- + .../core_ext/string/output_safety.rb | 50 ++++++++++++------- + activesupport/test/safe_buffer_test.rb | 46 ++++++++++++++++-- + 3 files changed, 74 insertions(+), 24 deletions(-) + +diff --git a/actionpack/lib/action_view/helpers/capture_helper.rb b/actionpack/lib/action_view/helpers/capture_helper.rb +index cbc660d..c91e4c1 100644 +--- a/actionpack/lib/action_view/helpers/capture_helper.rb ++++ b/actionpack/lib/action_view/helpers/capture_helper.rb +@@ -179,7 +179,7 @@ module ActionView + def flush_output_buffer #:nodoc: + if output_buffer && !output_buffer.empty? + response.body_parts << output_buffer +- self.output_buffer = output_buffer[0,0] ++ self.output_buffer = output_buffer.respond_to?(:clone_empty) ? output_buffer.clone_empty : output_buffer[0, 0] + nil + end + end |