You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

553321-ansi-escape-segfault.patch 840B

1234567891011121314151617181920212223242526272829
  1. From: Antonio Radici <antonio@debian.org>
  2. Date: Thu, 27 Feb 2014 16:56:37 +0100
  3. Subject: 553321-ansi-escape-segfault
  4. This patch prevents Mutt from crashing when *buf is freed,
  5. the root cause is the fact that an adjacent memory segment
  6. (*fmt) overruns and overwrite prev_size field in the heap.
  7. The bug and the patch were forwarded upstream,
  8. see http://bugs.mutt.org/3371
  9. Gbp-Pq: Topic upstream
  10. ---
  11. pager.c | 2 +-
  12. 1 file changed, 1 insertion(+), 1 deletion(-)
  13. diff --git a/pager.c b/pager.c
  14. index b17afb4..7b61266 100644
  15. --- a/pager.c
  16. +++ b/pager.c
  17. @@ -1053,7 +1053,7 @@ fill_buffer (FILE *f, LOFF_T *last_pos, LOFF_T offset, unsigned char **buf,
  18. q = *fmt;
  19. while (*p)
  20. {
  21. - if (*p == '\010' && (p > *buf))
  22. + if (*p == '\010' && (p > *buf) && (q > *fmt))
  23. {
  24. if (*(p+1) == '_') /* underline */
  25. p += 2;