aboutsummaryrefslogtreecommitdiff
path: root/www/tidy-devel/files/patch-src_lexer.c
diff options
context:
space:
mode:
Diffstat (limited to 'www/tidy-devel/files/patch-src_lexer.c')
-rw-r--r--www/tidy-devel/files/patch-src_lexer.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/www/tidy-devel/files/patch-src_lexer.c b/www/tidy-devel/files/patch-src_lexer.c
new file mode 100644
index 000000000000..a34e4bdf6a60
--- /dev/null
+++ b/www/tidy-devel/files/patch-src_lexer.c
@@ -0,0 +1,23 @@
+--- src/lexer.c.orig 2008-03-22 21:06:55 UTC
++++ src/lexer.c
+@@ -3467,16 +3467,17 @@ static tmbstr ParseValue( TidyDocImpl* d
+ /* and prompts attributes unless --literal-attributes is set to yes */
+ /* #994841 - Whitespace is removed from value attributes */
+
+- if (munge &&
++ /* Issue #217 from tidy-html5 - 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;