Fixed one instance of strcpy(). The rest are proving tricky.
authorDavid Griffith <dave@661.org>
Sun, 3 Feb 2019 13:49:20 +0000 (05:49 -0800)
committerDavid Griffith <dave@661.org>
Sun, 3 Feb 2019 13:49:20 +0000 (05:49 -0800)
src/curses/ux_input.c

index c6876ab596d2f6022e449424f1d6c095be1fe02a..1181f5d2d339209528355ac678ed3e12aa7211ad 100644 (file)
@@ -330,7 +330,7 @@ static void unix_add_to_history(zchar *str)
     if (*history_next != NULL)
        free( *history_next);
     *history_next = (char *)malloc(strlen((char *)str) + 1);
-    strcpy( *history_next, (char *)str);
+    strncpy( *history_next, (char *)str, strlen((char*)str) + 1);
     RING_INC( history_next, history_buffer, history_end);
     history_view = history_next; /* Reset user frame after each line */