* edit.c (edit_push_action): Fix access to uninitialized memory.

Found by Valgrind.
This commit is contained in:
Pavel Roskin 2002-08-02 16:44:04 +00:00
parent 0c94e1531b
commit 21cc1c5e28
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2002-08-02 Paul Sheer <psheer@icon.co.za>
* edit.c (edit_push_action): Fix access to uninitialized memory.
Found by Valgrind.
2002-08-01 Pavel Roskin <proski@gnu.org>
* syntax.c: Remove all references to MAD.

View File

@ -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];