From 4a619dc66e250d5e00557a1fb6ad07f2f45f76de Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 7 Dec 2015 18:31:51 +0200 Subject: [PATCH] Fix a buffer overflow in ee Original patch by Neil Moore --- ee.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee.c b/ee.c index b26c913..08210fe 100644 --- a/ee.c +++ b/ee.c @@ -1968,7 +1968,7 @@ int *append; /* TRUE if must append more text to end of current line */ struct text *tline; /* temporary pointer to new line */ int first_time; /* if TRUE, the first time through the loop */ wchar_t in_string[MAX_FILE]; - length = mbstowcs(in_string, in_str, sizeof(in_string)); + length = mbstowcs(in_string, in_str, sizeof(in_string)/sizeof(wchar_t)); if (length == -1) { wmove(com_win, 0, 0); -- 2.47.3