PATCH: Starbase StarTeam 4.2 crash fixed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all

I got StarTeam 4.2 from Starbase (Borland nowadays) running with wine
snapshot 2003-02-19 with modifications mentioned below in this email.

Problem location: dlls/comctl32/listview.c

In function static inline COLUMN_INFO *
LISTVIEW_GetColumnInfo(LISTVIEW_INFO
*infoPtr, INT nSubItem)   (listview.c:1237) ... assert (nSubItem >= 0 &&
nSubItem < infoPtr->hdpaColumns->nItemCount); ... the assert statement
sometimes fails because sometimes nSubItem is -1 and  nItemCount is 0
(nSubItem is an index, nItemCount the number of elements).

Unfortunately this happens everytime you try to open a project in StarTeam.

So far, I found only one spot where LISTVIEW_GetColumnInfo is called with
wrong parameters: LISTVIEW_ScrollColumns: static void
LISTVIEW_ScrollColumns(LISTVIEW_INFO *infoPtr, INT nColumn,
INT dx) (listview.c:4006) ... lpColumnInfo =
LISTVIEW_GetColumnInfo(infoPtr, min(nColumn,
infoPtr->hdpaColumns->nItemCount - 1)); ...

The error happens because of the min thing in case nItemCount is 0 (no
columns...) and therfore decremented to -1. Maybe the Windows
implementation is more reclutant about this, though I have not windows to
test this on. I now return immediately from LISTVIEW_ScrollColumns if the
nColumn is < 0 or  nItemCount is < 1.

This little change made StarTeam 4.2 runnable on my Linux Box.

Attached you'll find a diff based on wine snapshot 2003-02-19.

Changelog:
    Stefan Haller <stefan.haller@ascom.ch>
    Ignoring requests to scroll non-existent columns
(LISTVIEW_ScrollColumns).


(See attached file: patch.diff)

Keep up the great work, folks!

Cheers
 Stefan

--
Stefan Haller
Software Development
Ascom Transport Revenue

Attachment: patch.diff
Description: Binary data


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux