fix a core dump

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1040 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-08-24 02:36:46 +00:00
parent 57c974b88a
commit 7e05648e07
2 changed files with 17 additions and 3 deletions

View File

@ -664,11 +664,9 @@ xaccConfigSplitRegister (SplitRegister *reg, int newtype)
{
if (!reg) return;
/* before reconfiguring, clean up any messy state that may be lying about */
xaccVerifyCursorPosition (reg->table, -1, -1);
reg->type = newtype;
configLayout (reg);
configTraverse (reg);
configCursors (reg);
}

View File

@ -447,6 +447,22 @@ traverseCB (Widget mw, XtPointer cd, XtPointer cb)
}
}
/* Don't do a thing unless we verify that the row and column
* are in bounds. Ordinarily, they are always in bounds, except
* in an unusual, arguably buggy situation: If the table has
* been recently resized smaller, then the Xbae code might report
* a traverse out of a cell that was in the larger array, but not
* in the smaller array. This is probably an Xbae bug. It
* will core dump array access.
*/
if ((row >= table->num_phys_rows) ||
(col >= table->num_phys_cols)) {
table->prev_phys_traverse_row = cbs->next_row;
table->prev_phys_traverse_col = cbs->next_column;
return;
}
xaccVerifyCursorPosition (table, row, col);
/* compute the cell location */