Menu

#79 columns or rows out of bound

open
nobody
Bugs (67)
5
2010-07-20
2010-07-20
Anonymous
No

The file Matrix.c, function SetValues (Line 2428) did not check if current_column is out ob bounds. Sometimes current_column is <0, resulting in accessing an invalid new->matrix.column_widths[current_column]. This can be patches by simply checking the values before doing the access, could be solved:
if (current_column >= new->matrix.columns || current_column<0 || new->matrix.column_widths[current_column] == 0) {
XtVaSetValues(TextField(new), XmNattachRow, -1, XmNattachColumn, -1, NULL);
if (new->matrix.text_field_is_mapped) {
hide_text_field = True;
}
}
The same in Utils.c, Function xbaeMatrixYtoRow Line 845. Sometimes *row is <0, resulting in an invalid access. I have added the following:
if(*row<0)
DEBUGOUT(_XbaeDebug(__FILE__, (Widget) mw, "xbaeMatrixYtoRow y is %d row is %d\n",(int)*y,(int)*row));
else
*y -= ROW_POSITION(mw, *row);

Discussion


Log in to post a comment.