- don't free user-supplied string (via -e)
[oweals/busybox.git] / libbb / lineedit.c
index 2e16e6a0ac9d9860d81958a0ddab7dc2fef7a966..3e16f642311c3e95c9488c6f5cfb4c3fac53326a 100644 (file)
@@ -345,7 +345,7 @@ static void input_delete(int save)
        }
 #endif
 
-       strcpy(command_ps + j, command_ps + j + 1);
+       overlapping_strcpy(command_ps + j, command_ps + j + 1);
        command_len--;
        input_end();                    /* rewrite new line */
        cmdedit_set_out_char(' ');      /* erase char */
@@ -1552,7 +1552,7 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li
                vi_case(CTRL('U')|vbit:)
                        /* Control-U -- Clear line before cursor */
                        if (cursor) {
-                               strcpy(command, command + cursor);
+                               overlapping_strcpy(command, command + cursor);
                                command_len -= cursor;
                                redraw(cmdedit_y, command_len);
                        }