tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* Memory errors (w/patch)
@ 2014-08-18 13:30 Kristaps Dzonsons
  2014-08-18 19:41 ` Ingo Schwarze
  0 siblings, 1 reply; 2+ messages in thread
From: Kristaps Dzonsons @ 2014-08-18 13:30 UTC (permalink / raw)
  To: tech

[-- Attachment #1: Type: text/plain, Size: 255 bytes --]

Hi,

Found by valgrind, again.  I think this one's fairly straightforward... 
Enclosed patch should speak for itself!

This can be triggered by the following:

----
.TH PLOCKSTAT 1 "July 2007" "1.0" ""
.SH NAME
plockstat \-
\fB
----

Ok?

Best,

Kristaps

[-- Attachment #2: term.diff --]
[-- Type: text/plain, Size: 516 bytes --]

Index: term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term.c,v
retrieving revision 1.227
diff -u -p -r1.227 term.c
--- term.c	10 Aug 2014 23:54:41 -0000	1.227
+++ term.c	18 Aug 2014 13:30:17 -0000
@@ -220,7 +220,7 @@ term_flushln(struct termp *p)
 				break;
 			if (' ' == p->buf[i]) {
 				j = i;
-				while (' ' == p->buf[i])
+				while (i < p->col && ' ' == p->buf[i])
 					i++;
 				dv = (i - j) * (*p->width)(p, ' ');
 				vbl += dv;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-18 19:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-18 13:30 Memory errors (w/patch) Kristaps Dzonsons
2014-08-18 19:41 ` Ingo Schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).