Commit 86b6c3e5 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

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
No related merge requests found
Showing with 1 addition and 1 deletion
+1 -1
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment