summaryrefslogtreecommitdiff
path: root/cpan/Encode/Unicode
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2011-08-09 10:02:28 +0100
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2011-08-09 11:25:57 +0100
commite46d973584785af1f445c4dedbee4243419cb860 (patch)
tree3993978bd4a3291fb92d9d3633d030cf74c557b1 /cpan/Encode/Unicode
parent1bfdb6af4f349a4b4de3ed9a093dab259c05c37e (diff)
downloadperl-e46d973584785af1f445c4dedbee4243419cb860.tar.gz
Update Encode to CPAN version 2.44
[DELTA] $Revision: 2.44 $ $Date: 2011/08/09 07:49:44 $ ! Unicode/Unicode.xs Addressed the following: Date: Fri, 22 Jul 2011 13:58:43 +0200 From: Robert Zacek <zacek@avast.com> To: perl5-security-report@perl.org Subject: Unicode.xs!decode_xs n-byte heap-overflow ! Encode.pm encoding.pm ! lib/Encode/Alias.pm lib/Encode/Encoder.pm lib/Encode/Guess.pm Applied: RT#69735: patch for use constant DEBUG => https://rt.cpan.org/Ticket/Update.html?id=69735
Diffstat (limited to 'cpan/Encode/Unicode')
-rw-r--r--cpan/Encode/Unicode/Unicode.xs7
1 files changed, 5 insertions, 2 deletions
diff --git a/cpan/Encode/Unicode/Unicode.xs b/cpan/Encode/Unicode/Unicode.xs
index 16f4cd1ff2..039f1559a3 100644
--- a/cpan/Encode/Unicode/Unicode.xs
+++ b/cpan/Encode/Unicode/Unicode.xs
@@ -1,5 +1,5 @@
/*
- $Id: Unicode.xs,v 2.7 2010/12/31 22:48:48 dankogai Exp $
+ $Id: Unicode.xs,v 2.8 2011/08/09 07:49:44 dankogai Exp dankogai $
*/
#define PERL_NO_GET_CONTEXT
@@ -256,7 +256,10 @@ CODE:
This prevents allocating too much in the rogue case of a large
input consisting initially of long sequence uft8-byte unicode
chars followed by single utf8-byte chars. */
- STRLEN remaining = (e - s)/usize;
+ /* +1
+ fixes Unicode.xs!decode_xs n-byte heap-overflow
+ */
+ STRLEN remaining = (e - s)/usize + 1; /* +1 to avoid the leak */
STRLEN max_alloc = remaining + (8*1024*1024);
STRLEN est_alloc = remaining * UTF8_MAXLEN;
STRLEN newlen = SvLEN(result) + /* min(max_alloc, est_alloc) */