From: Todd C. Miller Date: Mon, 14 Feb 2011 16:28:50 +0000 (-0500) Subject: Truncate the buffer at buf.len before printing in the non-wordwrap case. X-Git-Tag: SUDO_1_7_5~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a946521729dfab48fba77cfd5b3f5295e893ce2a;p=sudo Truncate the buffer at buf.len before printing in the non-wordwrap case. --HG-- branch : 1.7 --- diff --git a/lbuf.c b/lbuf.c index a5e67bf91..d5adfdc1d 100644 --- a/lbuf.c +++ b/lbuf.c @@ -286,6 +286,7 @@ lbuf_print(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; }