summaryrefslogtreecommitdiff
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
parent247cdf53dff1fdb9ccafb5f0b4139c73bac6d9b0 (diff)
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.
-rw-r--r--gnu-system.am1
-rw-r--r--gnu/packages/patches/tidy-CVE-2015-5522+5523.patch36
-rw-r--r--gnu/packages/web.scm3
3 files changed, 39 insertions, 1 deletions
diff --git a/gnu-system.am b/gnu-system.am
index 011aa048361..2c361f2f1a5 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -619,6 +619,7 @@ dist_patch_DATA = \
619 gnu/packages/patches/teckit-cstdio.patch \ 619 gnu/packages/patches/teckit-cstdio.patch \
620 gnu/packages/patches/texi2html-document-encoding.patch \ 620 gnu/packages/patches/texi2html-document-encoding.patch \
621 gnu/packages/patches/texi2html-i18n.patch \ 621 gnu/packages/patches/texi2html-i18n.patch \
622 gnu/packages/patches/tidy-CVE-2015-5522+5523.patch \
622 gnu/packages/patches/tvtime-gcc41.patch \ 623 gnu/packages/patches/tvtime-gcc41.patch \
623 gnu/packages/patches/tvtime-pngoutput.patch \ 624 gnu/packages/patches/tvtime-pngoutput.patch \
624 gnu/packages/patches/tvtime-videodev2.patch \ 625 gnu/packages/patches/tvtime-videodev2.patch \
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 00000000000..7afb58aa149
--- /dev/null
+++ b/gnu/packages/patches/tidy-CVE-2015-5522+5523.patch
@@ -0,0 +1,36 @@
1Copied from Debian.
2
3From c18f27a58792f7fbd0b30a0ff50d6b40a82f940d Mon Sep 17 00:00:00 2001
4From: Geoff McLane <ubuntu@geoffair.info>
5Date: Wed, 3 Jun 2015 20:26:03 +0200
6Subject: [PATCH] Issue #217 - avoid len going negative, ever...
7
8---
9 src/lexer.c | 8 +++++---
10 1 file changed, 5 insertions(+), 3 deletions(-)
11
12diff --git a/src/lexer.c b/src/lexer.c
13index 376a3d8..664f806 100644
14--- a/src/lexer.c
15+++ b/src/lexer.c
16@@ -3739,16 +3740,17 @@ static tmbstr ParseValue( TidyDocImpl* doc, ctmbstr name,
17 /* and prompts attributes unless --literal-attributes is set to yes */
18 /* #994841 - Whitespace is removed from value attributes */
19
20- if (munge &&
21+ /* Issue #217 - Also only if/while (len > 0) - MUST NEVER GO NEGATIVE! */
22+ if ((len > 0) && munge &&
23 TY_(tmbstrcasecmp)(name, "alt") &&
24 TY_(tmbstrcasecmp)(name, "title") &&
25 TY_(tmbstrcasecmp)(name, "value") &&
26 TY_(tmbstrcasecmp)(name, "prompt"))
27 {
28- while (TY_(IsWhite)(lexer->lexbuf[start+len-1]))
29+ while (TY_(IsWhite)(lexer->lexbuf[start+len-1]) && (len > 0))
30 --len;
31
32- while (TY_(IsWhite)(lexer->lexbuf[start]) && start < len)
33+ while (TY_(IsWhite)(lexer->lexbuf[start]) && (start < len) && (len > 0))
34 {
35 ++start;
36 --len;
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 4123c0a9302..df0d9c4d681 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -381,7 +381,8 @@ UTS#46.")
381 (revision "2009-12-23"))) 381 (revision "2009-12-23")))
382 (sha256 382 (sha256
383 (base32 383 (base32
384 "14dsnmirjcrvwsffqp3as70qr6bbfaig2fv3zvs5g7005jrsbvpb")))) 384 "14dsnmirjcrvwsffqp3as70qr6bbfaig2fv3zvs5g7005jrsbvpb"))
385 (patches (list (search-patch "tidy-CVE-2015-5522+5523.patch")))))
385 (build-system gnu-build-system) 386 (build-system gnu-build-system)
386 (arguments 387 (arguments
387 '(#:phases (alist-cons-after 388 '(#:phases (alist-cons-after