tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Kristaps Dzonsons <kristaps@bsd.lv>
To: tech@mdocml.bsd.lv
Subject: Memory errors (w/patch)
Date: Mon, 18 Aug 2014 15:30:57 +0200	[thread overview]
Message-ID: <53F20011.7070600@bsd.lv> (raw)

[-- 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;

             reply	other threads:[~2014-08-18 13:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-18 13:30 Kristaps Dzonsons [this message]
2014-08-18 19:41 ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53F20011.7070600@bsd.lv \
    --to=kristaps@bsd.lv \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).