Copied from Debian. From c18f27a58792f7fbd0b30a0ff50d6b40a82f940d Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Wed, 3 Jun 2015 20:26:03 +0200 Subject: [PATCH] Issue #217 - avoid len going negative, ever... --- src/lexer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lexer.c b/src/lexer.c index 376a3d8..664f806 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -3739,16 +3740,17 @@ static tmbstr ParseValue( TidyDocImpl* doc, ctmbstr name, /* and prompts attributes unless --literal-attributes is set to yes */ /* #994841 - Whitespace is removed from value attributes */ - if (munge && + /* Issue #217 - Also only if/while (len > 0) - MUST NEVER GO NEGATIVE! */ + if ((len > 0) && munge && TY_(tmbstrcasecmp)(name, "alt") && TY_(tmbstrcasecmp)(name, "title") && TY_(tmbstrcasecmp)(name, "value") && TY_(tmbstrcasecmp)(name, "prompt")) { - while (TY_(IsWhite)(lexer->lexbuf[start+len-1])) + while (TY_(IsWhite)(lexer->lexbuf[start+len-1]) && (len > 0)) --len; - while (TY_(IsWhite)(lexer->lexbuf[start]) && start < len) + while (TY_(IsWhite)(lexer->lexbuf[start]) && (start < len) && (len > 0)) { ++start; --len; 7fa3afc32b4032435b9e7291f'>diff
Patch borrowed from nixpkgs.  Works around warning message produced by the
current version of Moose:

"Passing a list of values to enum is deprecated. Enum values should be wrapped
in an arrayref."

--- Net-Amazon-S3-0.60/lib/Net/Amazon/S3/Client/Object.pm	2015-04-15 16:18:47.226410022 -0500
+++ Net-Amazon-S3-0.60/lib/Net/Amazon/S3/Client/Object.pm	2015-04-15 16:19:25.410408425 -0500
@@ -19,7 +19,7 @@
     [ qw(private public-read public-read-write authenticated-read) ];
 
 enum 'StorageClass' =>
-    qw(standard reduced_redundancy);
+    [ qw(standard reduced_redundancy) ];
 
 has 'client' =>
     ( is => 'ro', isa => 'Net::Amazon::S3::Client', required => 1 );