Ticket #46 (closed defect)

Opened 8 years ago

Last modified 8 years ago

nsufficient error checking for GetItemData

Reported by: anonymous Owned by: vadz
Priority: normal Milestone:
Component: wxGTK Version:
Keywords: Cc: vadz
Blocked By: Patch: no
Blocking:

Description

Bug#: 115
Product: .wxWindows
Version: 2.2.0
Platform: wxGTK
OS/Version: Linux - RedHat
Status: NEW
Resolution:
Severity: normal
Priority: P2
Component: wxGTK
AssignedTo: ???
ReportedBy: br_9801@…
URL:
Summary: insufficient error checking for GetItemData (and others)

Calling treectrl->GetItemData(id) will return a pointer to
a deleted object if the item corresponding to the id has
been deleted (e.g., with CollapseAndReset). It should probably
return NULL instead.

More generally, there is no documented way of finding out
whether an item id is valid.

Change History

Changed 8 years ago by vadz

use IsOk() to check the item for now, we'll see if something better can be done later (in any case, it will be an assert failure and not silent return of NULL)

Note: See TracTickets for help on using tickets.