nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 86b6c3e5db74925595d11dd60ec93ab53549f2ab
parent 62a2528ab845a2c8407aaba018f1400c42812d61
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Tue,  4 Oct 2005 03:40:41 +0000

in display_string(), *really* avoid a memory corruption problem by
allocating enough space for (COLS + 1) characters


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3034 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
Msrc/winio.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/winio.c b/src/winio.c @@ -2328,7 +2328,7 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool assert(column <= start_col); /* Allocate enough space for the entire line. */ - alloc_len = (mb_cur_max() * COLS); + alloc_len = (mb_cur_max() * (COLS + 1)); converted = charalloc(alloc_len + 1); index = 0;