Page MenuHomePhabricator

Potential crash in data manager drag-and-drop
Closed, ResolvedPublic

Description

QmitkDataStorageTreeModel accepts "application/x-qabstractitemmodeldatalist" format.
It's general tree data item format that means that QmitkDataStorageTreeModel accepts almost any item from any QTreeWidget.
But later QmitkDataStorageTreeModel casts data items to "application/x-qmitk-datastorage-treeitem-ptrs" and if cast fails, ToTreeItemPtrList() returns empty list. When accessing the first element of this empty list, crash occurs.

I can't reproduce this crash in MITK because I didn't find the second tree widget but I encountered this in our MITK fork.

https://github.com/MITK/MITK/pull/146 solves this issue.