blackberry/Qt — Issue #1: Segmentation fault on clipboard clearing
Author: dkonigsberg
Created: 2011-10-23 02:58:01+00:00
State: open

Calling the clear function on the clipboard, from within an app, will cause the app to crash with a SIGSEGV:
QApplication::clipboard()->clear(QClipboard::Clipboard);

The problem is that the implementation of this method calls QBBClipboard's setMimeData() function with a 0 for the data parameter, and that case is not handled before trying to dereference it.

The fix is simple. Just add "if(data == 0) return;" right after the call to "empty_clipboard();" inside of QBBClipboard::setMimeData().