]> granicus.if.org Git - mutt/commitdiff
fix buffer underrun when processing ANSI escape sequences
authorMichael Elkins <me@sigpipe.org>
Sun, 8 Aug 2010 21:52:50 +0000 (14:52 -0700)
committerMichael Elkins <me@sigpipe.org>
Sun, 8 Aug 2010 21:52:50 +0000 (14:52 -0700)
closes #3371

pager.c

diff --git a/pager.c b/pager.c
index 484f44120efdbc3b6b5313119cb63dd3403e88f5..0c2259f0e70cd7587339637915cc2c14e361ed19 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -1057,7 +1057,7 @@ fill_buffer (FILE *f, LOFF_T *last_pos, LOFF_T offset, unsigned char **buf,
       {
        if (*(p+1) == '_')      /* underline */
          p += 2;
-       else if (*(p+1))        /* bold or overstrike */
+       else if (*(p+1) && q > *fmt)    /* bold or overstrike */
        {
          *(q-1) = *(p+1);
          p += 2;