BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003874 [BusyBox] Other crash always 06-26-08 19:53 06-27-08 14:31
Reporter rockeychu View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version svn
Summary 0003874: Applet vi corrupted since Revision 22460
Description Since Revision 22460, the applet vi worked incorrectly.

Patch as following against revision 22525:

Index: editors/vi.c
===================================================================
--- editors/vi.c (revision 22525)
+++ editors/vi.c (working copy)
@@ -1883,8 +1883,7 @@
 {
        if (size <= 0)
                return p;
- end += size; // adjust the new END
- if (end >= (text + text_size)) {
+ if ((end + size) >= (text + text_size)) {
                char *new_text;
                text_size += end - (text + text_size) + 10240;
                new_text = xrealloc(text, text_size);
@@ -1895,6 +1894,7 @@
                text = new_text;
        }
        memmove(p + size, p, end - p);
+ end += size; // adjust the new END
        memset(p, ' ', size); // clear new hole
        file_modified++;
        return p;
Additional Information
Attached Files

- Relationships

- Notes
(0008604)
vda
06-26-08 21:01

Should this line be fixed too?

text_size += end - (text + text_size) + 10240;
 
(0008614)
vda
06-26-08 21:05

I will commit this fix instead, is it ok?

- memmove(p + size, p, end - p);
+ memmove(p + size, p, end - size - p);
 
(0008624)
rockeychu
06-26-08 21:17

It's OK.
 
(0008634)
vda
06-27-08 14:31

Fixed in svn, thanks.
 

- Issue History
Date Modified Username Field Change
06-26-08 19:53 rockeychu New Issue
06-26-08 19:53 rockeychu Status new => assigned
06-26-08 19:53 rockeychu Assigned To  => BusyBox
06-26-08 21:01 vda Note Added: 0008604
06-26-08 21:05 vda Note Added: 0008614
06-26-08 21:17 rockeychu Note Added: 0008624
06-27-08 14:31 vda Status assigned => closed
06-27-08 14:31 vda Note Added: 0008634
06-27-08 14:31 vda Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker