kern/117348: Loading history file sometimes fails in libedit

Martin Beran mb at
Fri Oct 19 16:10:03 PDT 2007

>Number:         117348
>Category:       kern
>Synopsis:       Loading history file sometimes fails in libedit
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 19 23:10:02 UTC 2007
>Originator:     Martin Beran
>Release:        6.2-RELEASE-p4
Trusted Network Solutions, a. s.
FreeBSD 6.2-RELEASE-p4 FreeBSD 6.2-RELEASE-p4 #0: Sun Apr 29 22:31:25 CEST 2007     root at  i386

Under some circumstances, loading history in libedit by history(H_LOAD) causes abnormal program termination due to invalid memory access on line 693 of /usr/src/lib/libedit/history.c.

Compile the following program with ElectricFence
#include <histedit.h>
int main(int argc, char* argv[])
    History* h = history_init();
    HistEvent ev;
    history(h, &ev, H_LOAD, argv[1]);
    return 0;
and run it with a history file 4096 bytes long containing
followed by 63 copies of line:


More information about the freebsd-bugs mailing list