[BusyBox 0005824]: Since version 23530 with lineedit.c, "fdisk" & "ed" can't work any more
bugs at busybox.net
bugs at busybox.net
Sat Nov 1 22:56:20 UTC 2008
A NOTE has been added to this issue.
======================================================================
http://busybox.net/bugs/view.php?id=5824
======================================================================
Reported By: rockeychu
Assigned To: BusyBox
======================================================================
Project: BusyBox
Issue ID: 5824
Category: Other
Reproducibility: always
Severity: crash
Priority: normal
Status: assigned
======================================================================
Date Submitted: 10-29-2008 06:51 PDT
Last Modified: 11-01-2008 15:56 PDT
======================================================================
Summary: Since version 23530 with lineedit.c, "fdisk" & "ed"
can't work any more
Description:
The reason is:
The function read_line_input() declared as: int FAST_FUNC
read_line_input(const char *prompt, char *command, int maxsize,
line_input_t *st)
But, when "fdisk" or "ed" calls read_line_input() with last param "st" set
as NULL, variable "state" will set as "(line_input_t*)&const_int_0" witch
just as "const int const_int_0 = 0", so, line 1418 will cause Segmentation
fault.
Patch as following:
Index: libbb/lineedit.c
===================================================================
--- libbb/lineedit.c (revision 23852)
+++ libbb/lineedit.c (working copy)
@@ -1415,7 +1415,8 @@
if ((state->flags & SAVE_HISTORY) && state->hist_file)
load_history(state->hist_file);
#endif
- state->cur_history = state->cnt_history;
+ if (state->flags)
+ state->cur_history = state->cnt_history;
/* prepare before init handlers */
cmdedit_y = 0; /* quasireal y, not true if line > xt*yt */
======================================================================
----------------------------------------------------------------------
timtim - 11-01-08 15:56
----------------------------------------------------------------------
I have this in 1.11.3 and this suggested fix works.
Issue History
Date Modified Username Field Change
======================================================================
10-29-08 06:51 rockeychu New Issue
10-29-08 06:51 rockeychu Status new => assigned
10-29-08 06:51 rockeychu Assigned To => BusyBox
11-01-08 15:56 timtim Note Added: 0014794
======================================================================
More information about the busybox-cvs
mailing list