diff --git a/src/ChangeLog b/src/ChangeLog index 887cd1681..c85149237 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,8 @@ 2005-07-22 Roland Illig * ext.c: Fixed a typo which has been noted by Arpad Biro. + * help.c: Fixed an invalid memory access, which has been noted + by Vitja Makarov. 2005-07-20 Roland Illig diff --git a/src/help.c b/src/help.c index 5540677f1..29b25759c 100644 --- a/src/help.c +++ b/src/help.c @@ -551,10 +551,17 @@ static void help_help_cmd (void *data) { Dlg_head *h = data; + const char *p; + history_ptr = (history_ptr+1) % HISTORY_SIZE; history [history_ptr].page = currentpoint; history [history_ptr].link = selected_item; - currentpoint = startpoint = search_string (data, "[How to use help]") + 1; + + p = search_string(data, "[How to use help]"); + if (p == NULL) + return; + + currentpoint = startpoint = p + 1; selected_item = NULL; help_callback (h, DLG_DRAW, 0); }