Bad Cast in TAssociation::EntryWithKey

1379825

Aug 17 1996 10:41PM


In TAssociation::EntryWithKey, appears the line:

return (TEntry *)fEntries->Search(&CompareEntryKeys, &aCEntryWithKey);

This is casting an array index to a TEntry*. This causes a crash when opening the second "views by ..." window in DemoDialogs.

It looks like this change was made during recent global changes involving eliminating TObject, using auto pointers, etc., so this should be looked at carefully to determine if a related pattern may have been introduced elsewhere in the code.


Fix:

Switched to fEntries->DoSearch throughout UAssociation.cp. This call returns a pointer instead of an index.