aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2015-07-20 23:32:30 -0400
committerMark H Weaver <mhw@netris.org>2015-07-20 23:33:41 -0400
commit4d85391059604959a010c39953bea5c62f52dc90 (patch)
treefcf1ca4bafe4f5cf8dd351b85637f51348602397 /gnu/packages/patches
parent247cdf53dff1fdb9ccafb5f0b4139c73bac6d9b0 (diff)
downloadguix-4d85391059604959a010c39953bea5c62f52dc90.tar.gz
guix-4d85391059604959a010c39953bea5c62f52dc90.zip
gnu: tidy: Add fixes for CVE-2015-5522 and CVE-2015-5523.
* gnu/packages/patches/tidy-CVE-2015-5522+5523.patch: New file. * gnu-system.am (dist_patch_DATA): Add it. * gnu/packages/web.scm (tidy)[source]: Add patch.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/tidy-CVE-2015-5522+5523.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/gnu/packages/patches/tidy-CVE-2015-5522+5523.patch b/gnu/packages/patches/tidy-CVE-2015-5522+5523.patch
new file mode 100644
index 0000000000..7afb58aa14
--- /dev/null
+++ b/gnu/packages/patches/tidy-CVE-2015-5522+5523.patch
@@ -0,0 +1,36 @@
+Copied from Debian.
+
+From c18f27a58792f7fbd0b30a0ff50d6b40a82f940d Mon Sep 17 00:00:00 2001
+From: Geoff McLane <ubuntu@geoffair.info>
+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;