applying:
authorpgf <pgf@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Tue, 19 Jul 2005 20:41:06 +0000 (20:41 +0000)
committerpgf <pgf@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Tue, 19 Jul 2005 20:41:06 +0000 (20:41 +0000)
0000054: Tab completing filenames in ash causes SEGV
Simple tab completion operations cause busybox (ash) to
access illegal addresses.

git-svn-id: svn://busybox.net/trunk/busybox@10861 69ca8d6d-28ef-0310-b511-8ec308f3f277

shell/cmdedit.c

index 56b789a..3380dff 100644 (file)
@@ -782,8 +782,8 @@ static int match_compare(const void *a, const void *b)
 #define QUOT    (UCHAR_MAX+1)
 
 #define collapse_pos(is, in) { \
-       memcpy(int_buf+(is), int_buf+(in), (BUFSIZ+1-(is)-(in))*sizeof(int)); \
-       memcpy(pos_buf+(is), pos_buf+(in), (BUFSIZ+1-(is)-(in))*sizeof(int)); }
+       memmove(int_buf+(is), int_buf+(in), (BUFSIZ+1-(is)-(in))*sizeof(int)); \
+       memmove(pos_buf+(is), pos_buf+(in), (BUFSIZ+1-(is)-(in))*sizeof(int)); }
 
 static int find_match(char *matchBuf, int *len_with_quotes)
 {