| Anonymous | Login | Signup for a new account | 11-10-2008 10:43 PST |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0000191 | [BusyBox] Other | major | always | 03-24-05 02:58 | 08-01-05 11:18 | ||||
| Reporter | hornet | View Status | public | ||||||
| Assigned To | BusyBox | ||||||||
| Priority | normal | Resolution | duplicate | ||||||
| Status | closed | Product Version | 1.00 | ||||||
| Summary | 0000191: memcpy used on overlapping areas in shell/cmdedit.c | ||||||||
| Description |
Using busybox on SH4 platform (STi5528, http://www.superhlinux.com) [^] ash crashes during TAB command line completion (always if used as parameter completion, rarely as command completion). There is macro in shell/cmdedit.c: #define collapse_pos(is, in) { \ memcopy(int_buf+(is), int_buf+(in), (BUFSIZ+1-(is)-(in))*sizeof(int)); \ memcopy(pos_buf+(is), pos_buf+(in), (BUFSIZ+1-(is)-(in))*sizeof(int)); } Meantime it is written in memcopy manual: The memcpy() function copies n bytes from memory area src to memory area dest. THE MEMORY AREAS MAY NOT OVERLAP. Use memmove(3) if the memory areas do overlap. So, the correct macro is: #define collapse_pos(is, in) { \ 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)); } And it solves the problem :-) |
||||||||
| Additional Information | |||||||||
| Attached Files | |||||||||
|
|
|||||||||
Notes |
|
|
(0000116) hornet 03-24-05 03:01 |
Well. Now I have realized that it is a duplication of http://busybox.net/bugs/view.php?id=54 [^] bug. Pity I have not checked it earlier... :-( |
|
(0000369) pgf 08-01-05 11:18 |
dup of 54 |
| Copyright © 2000 - 2006 Mantis Group |