aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/tidy-CVE-2015-5522+5523.patch
blob: 7afb58aa1492e616dbcac3c17ddd0c198871b622 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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;
nup' service to '%base-services' for build logs....Ludovic Courtès 2022-03-10services: guix: Add 'generate-substitute-key?' field....Ludovic Courtès 2022-02-25agetty-shepherd-service: Rename console agetty to "term-console" for clarity....Danny Milosavljevic 2022-02-25services: %base-services: Adapt agetty-service-type to depend on syslogd...Danny Milosavljevic 2022-02-25services: agetty: Add shepherd-requirement....Danny Milosavljevic 2022-02-20services: udev: Use a fixed location for the rules directory and config....Maxim Cournoyer 2022-01-20services: guix-publish: Add negative-ttl parameter....Guillaume Le Vaillant 2022-01-18daemon: Always default to gzip for log compression....Ludovic Courtès 2022-01-16services: guix: Add tar and gzip to PATH....Timothy Sample 2022-01-08services: networking: Add netmask to loopback address....Ludovic Courtès 2021-12-21services: static-networking: Enable multicast by default....Mathieu Othacehe 2021-12-20services: static-networking: Sanitize <network-address> values....Ludovic Courtès 2021-12-12services: Define '%loopback-static-networking'....Ludovic Courtès 2021-12-12services: Define '%qemu-static-networking'....Ludovic Courtès 2021-12-12services: static-networking: Change interface to mimic netlink....Ludovic Courtès 2021-12-12services: static-networking: Use Guile-Netlink on GNU/Linux....Ludovic Courtès 2021-11-30services: Accept <inferior-package>s in lieu of <package>s....Tobias Geerinckx-Rice 2021-11-23gnu: system: Make old-style swap use default flags....Josselin Poiret 2021-11-23system: Add swap flags....Josselin Poiret 2021-11-23system: Rework swap space support, add dependencies....Josselin Poiret 2021-08-29services: base: Honor file-system-create-mount-point? at all times....Maxim Cournoyer 2021-08-07services: pam-limits: fix limits.conf location...muradm 2021-08-04services: guix: Use "match-record" in activation....Brice Waegeneire 2021-07-13services: gpm: Use "make-forkexec-contstructor"....Brice Waegeneire 2021-06-29services: kmscon: Add keyboard-layout fields....luhui 2021-06-19services: guix: Authorize 'bordeaux.guix.gnu.org.pub' by default....Jack Hill 2021-06-14services: Remove deprecated service procedures....Ludovic Courtès 2021-04-03services: guix-publish: Add zstd compression by default....Ludovic Courtès 2021-04-01services: kmscon: Add font-engine and font-size fields....qblade 2021-03-18services: Enable "protected hardlinks" and "protected symlinks" by default....Leo Famulari 2021-01-13services: shepherd: 'shepherd-service-type' requires documentation....Ludovic Courtès