From: Todd C. Miller Date: Mon, 14 Feb 2011 16:28:44 +0000 (-0500) Subject: Truncate the buffer at buf.len before printing in the non-wordwrap case. X-Git-Tag: SUDO_1_8_0~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=151af9302235ab1c600a0b9b1308954f9c2689cf;p=sudo Truncate the buffer at buf.len before printing in the non-wordwrap case. --- diff --git a/common/lbuf.c b/common/lbuf.c index 5d7f687b8..16e745e2e 100644 --- a/common/lbuf.c +++ b/common/lbuf.c @@ -218,6 +218,7 @@ lbuf_print(struct lbuf *lbuf) /* For very small widths just give up... */ if (lbuf->cols <= lbuf->indent + contlen + 20) { + lbuf->buf[lbuf->len] = '\0'; lbuf->output(lbuf->buf); goto done; }