]> skyeroc.xyz Git - dgamelaunch/commitdiff
Fix a buffer overflow in ee
authorPasi Kallinen <paxed@alt.org>
Mon, 7 Dec 2015 16:31:51 +0000 (18:31 +0200)
committerPasi Kallinen <paxed@alt.org>
Mon, 7 Dec 2015 16:31:54 +0000 (18:31 +0200)
Original patch by Neil Moore <neil@s-z.org>

ee.c

diff --git a/ee.c b/ee.c
index b26c913c241abbbafb65881a96aafb9bd7f03786..08210feb66734f330dd7b3e5f6796f5a32b39196 100644 (file)
--- 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);