diff --git a/edit/ChangeLog b/edit/ChangeLog index 77a4d2afd..ee639e223 100644 --- a/edit/ChangeLog +++ b/edit/ChangeLog @@ -1,3 +1,8 @@ +2002-08-02 Paul Sheer + + * edit.c (edit_push_action): Fix access to uninitialized memory. + Found by Valgrind. + 2002-08-01 Pavel Roskin * syntax.c: Remove all references to MAD. diff --git a/edit/edit.c b/edit/edit.c index c6f3f12d4..2d9aa8569 100644 --- a/edit/edit.c +++ b/edit/edit.c @@ -715,7 +715,9 @@ void edit_push_action (WEdit * edit, long c,...) va_end (ap); } else #endif /* ! FAST_MOVE_CURSOR */ - if (spm1 != edit->stack_bottom && ((sp - 2) & edit->stack_size_mask) != edit->stack_bottom) { + if (edit->stack_bottom != sp + && spm1 != edit->stack_bottom + && ((sp - 2) & edit->stack_size_mask) != edit->stack_bottom) { int d; if (edit->undo_stack[spm1] < 0) { d = edit->undo_stack[(sp - 2) & edit->stack_size_mask];