summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-07-24 08:18:34 +0000
committerMike Frysinger <vapier@gentoo.org>2010-07-24 08:18:34 +0000
commitdbaefd9ed6bc93042a2d079653ea9aa7889db10a (patch)
treed921ebdb7464085e5ec9b7fd9b49e270051165e7 /sys-apps/groff/files
parentApply patch from kde-testing that fixes doc building. (diff)
downloadgentoo-2-dbaefd9ed6bc93042a2d079653ea9aa7889db10a.tar.gz
gentoo-2-dbaefd9ed6bc93042a2d079653ea9aa7889db10a.tar.bz2
gentoo-2-dbaefd9ed6bc93042a2d079653ea9aa7889db10a.zip
Add tmac fix from upstream #263524 by Horst Prote. Add memory fixes from upstream #294045 by Maurice van der Pot.
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/groff/files')
-rw-r--r--sys-apps/groff/files/groff-1.20.1-Thtml-mem-leak.patch70
-rw-r--r--sys-apps/groff/files/groff-1.20.1-double-frees-mem-leaks.patch98
-rw-r--r--sys-apps/groff/files/groff-1.20.1-tmac-ec.patch35
3 files changed, 203 insertions, 0 deletions
diff --git a/sys-apps/groff/files/groff-1.20.1-Thtml-mem-leak.patch b/sys-apps/groff/files/groff-1.20.1-Thtml-mem-leak.patch
new file mode 100644
index 000000000000..b95ed426280f
--- /dev/null
+++ b/sys-apps/groff/files/groff-1.20.1-Thtml-mem-leak.patch
@@ -0,0 +1,70 @@
+https://bugs.gentoo.org/294045
+
+From f68481cd98e1d8451dd16d6d1b1b3513110a5559 Mon Sep 17 00:00:00 2001
+From: wl <wl>
+Date: Fri, 10 Apr 2009 18:13:29 +0000
+Subject: [PATCH] Fix a memory leak in troff for -Thtml.
+ Reported by Urs Eggli <Urs.Eggli@zuerich.ch>.
+
+* src/roff/troff/node.h (node::~node): Move to...
+* src/roff/troff/node.cpp: Here. Free `state' and `push_state'.
+---
+ ChangeLog | 8 ++++++++
+ src/roff/troff/node.cpp | 11 ++++++++++-
+ src/roff/troff/node.h | 4 ----
+ 3 files changed, 18 insertions(+), 5 deletions(-)
+
+diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
+index afe4998..58cf59a 100644
+--- a/src/roff/troff/node.cpp
++++ b/src/roff/troff/node.cpp
+@@ -1811,6 +1811,14 @@ void suppress_output_file::really_transparent_char(unsigned char)
+ {
+ }
+
++inline node::~node()
++{
++ if (state != 0)
++ delete state;
++ if (push_state != 0)
++ delete push_state;
++}
++
+ /* glyphs, ligatures, kerns, discretionary breaks */
+
+ class charinfo_node : public node {
+@@ -4643,7 +4651,7 @@ void hline_node::tprint(troff_output_file *out)
+ }
+ else {
+ hunits rem = x - w*i;
+- if (rem > H0)
++ if (rem > H0) {
+ if (n->overlaps_horizontally()) {
+ if (out->is_on())
+ n->tprint(out);
+@@ -4651,6 +4659,7 @@ void hline_node::tprint(troff_output_file *out)
+ }
+ else
+ out->right(rem);
++ }
+ while (--i >= 0)
+ if (out->is_on())
+ n->tprint(out);
+diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h
+index a598ae5..9850be2 100644
+--- a/src/roff/troff/node.h
++++ b/src/roff/troff/node.h
+@@ -132,10 +132,6 @@ inline node::node(node *n, statem *s, int divlevel)
+ state = 0;
+ }
+
+-inline node::~node()
+-{
+-}
+-
+ // 0 means it doesn't, 1 means it does, 2 means it's transparent
+
+ int node_list_ends_sentence(node *);
+--
+1.7.1.1
+
diff --git a/sys-apps/groff/files/groff-1.20.1-double-frees-mem-leaks.patch b/sys-apps/groff/files/groff-1.20.1-double-frees-mem-leaks.patch
new file mode 100644
index 000000000000..d618030443a2
--- /dev/null
+++ b/sys-apps/groff/files/groff-1.20.1-double-frees-mem-leaks.patch
@@ -0,0 +1,98 @@
+https://bugs.gentoo.org/294045
+
+From be095a293e09eae67254f59ce878b1a36233b447 Mon Sep 17 00:00:00 2001
+From: wl <wl>
+Date: Tue, 24 Nov 2009 13:32:17 +0000
+Subject: [PATCH] Fix double frees and memory leaks.
+
+* src/roff/troff/env.cpp (environment::make_tag): Use local object.
+* src/roff/troff/input.cpp (input_stack::check_end_diversion): Free
+`diversion_state' here.
+(interpolate_arg): Fix memory leaks.
+* src/roff/troff/mtsm.cpp (mtsm::pop_state): Don't free `sp->state'.
+---
+ ChangeLog | 10 ++++++++++
+ src/roff/troff/env.cpp | 13 +++++++------
+ src/roff/troff/input.cpp | 5 +++++
+ src/roff/troff/mtsm.cpp | 2 --
+ 4 files changed, 22 insertions(+), 8 deletions(-)
+
+diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
+index 56bfe21..13672cc 100644
+--- a/src/roff/troff/env.cpp
++++ b/src/roff/troff/env.cpp
+@@ -2213,14 +2213,15 @@ node *environment::make_tag(const char *nm, int i)
+ */
+ if (curdiv == topdiv && topdiv->before_first_page)
+ topdiv->begin_page();
+- macro *m = new macro;
+- m->append_str("devtag:");
++
++ macro m;
++ m.append_str("devtag:");
+ for (const char *p = nm; *p; p++)
+ if (!invalid_input_char((unsigned char)*p))
+- m->append(*p);
+- m->append(' ');
+- m->append_int(i);
+- return new special_node(*m);
++ m.append(*p);
++ m.append(' ');
++ m.append_int(i);
++ return new special_node(m);
+ }
+ return 0;
+ }
+diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
+index 17d2451..7c816e8 100644
+--- a/src/roff/troff/input.cpp
++++ b/src/roff/troff/input.cpp
+@@ -531,6 +531,8 @@ void input_stack::check_end_diversion(input_iterator *t)
+ {
+ if (t->is_diversion) {
+ div_level--;
++ if (diversion_state)
++ delete diversion_state;
+ diversion_state = t->diversion_state;
+ }
+ }
+@@ -4398,6 +4400,7 @@ static void interpolate_arg(symbol nm)
+ args += c;
+ if (i != limit)
+ args += ' ';
++ delete p;
+ }
+ if (limit > 0) {
+ args += '\0';
+@@ -4419,6 +4422,7 @@ static void interpolate_arg(symbol nm)
+ args += '"';
+ if (i != limit)
+ args += ' ';
++ delete p;
+ }
+ if (limit > 0) {
+ args += '\0';
+@@ -4438,6 +4442,7 @@ static void interpolate_arg(symbol nm)
+ }
+ if (input_stack::space_follows_arg(i))
+ args += ' ';
++ delete p;
+ }
+ if (limit > 0) {
+ args += '\0';
+diff --git a/src/roff/troff/mtsm.cpp b/src/roff/troff/mtsm.cpp
+index 83a6906..79e2f78 100644
+--- a/src/roff/troff/mtsm.cpp
++++ b/src/roff/troff/mtsm.cpp
+@@ -390,8 +390,6 @@ void mtsm::pop_state()
+ #endif
+ if (sp == 0)
+ fatal("empty state machine stack");
+- if (sp->state)
+- delete sp->state;
+ sp->state = 0;
+ stack *t = sp;
+ sp = sp->next;
+--
+1.7.1.1
+
diff --git a/sys-apps/groff/files/groff-1.20.1-tmac-ec.patch b/sys-apps/groff/files/groff-1.20.1-tmac-ec.patch
new file mode 100644
index 000000000000..20a15c6e21a7
--- /dev/null
+++ b/sys-apps/groff/files/groff-1.20.1-tmac-ec.patch
@@ -0,0 +1,35 @@
+https://bugs.gentoo.org/263524
+
+revision 1.40
+date: 2009-04-01 02:59:08 -0400; author: wl; state: Exp; lines: +3 -3; commitid: VIC1bezuXvKqxhIt;
+
+* tmac/doc.tmac: Call `ec' before mapping characters.
+
+Index: tmac/doc.tmac
+===================================================================
+RCS file: /sources/groff/groff/tmac/doc.tmac,v
+retrieving revision 1.39
+retrieving revision 1.40
+diff -u -p -r1.39 -r1.40
+--- tmac/doc.tmac 2 Jan 2009 23:16:20 -0000 1.39
++++ tmac/doc.tmac 1 Apr 2009 06:59:08 -0000 1.40
+@@ -6425,6 +6425,9 @@
+ .blm doc-empty-line
+ .
+ .
++.ec
++.
++.
+ .\" For UTF-8, map some characters conservatively for the sake
+ .\" of easy cut and paste.
+ .
+@@ -6438,9 +6441,6 @@
+ .\}
+ .
+ .
+-.ec
+-.
+-.
+ .\" load local modifications
+ .mso mdoc.local
+ .