diff options
author | Sami Merila <sami.merila@nokia.com> | 2010-09-30 08:34:48 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2010-09-30 08:34:48 (GMT) |
commit | b9ab21b03dfebc7c5f8b4cbc2fdd2b880c7d9f99 (patch) | |
tree | 2faca6bf3e0239583af0ceabc2f55ece365ad177 /src/gui/styles/qs60style.cpp | |
parent | 6d980ae8985e3856ab87c4d0aaada3bcdc5fa1e5 (diff) | |
download | Qt-b9ab21b03dfebc7c5f8b4cbc2fdd2b880c7d9f99.zip Qt-b9ab21b03dfebc7c5f8b4cbc2fdd2b880c7d9f99.tar.gz Qt-b9ab21b03dfebc7c5f8b4cbc2fdd2b880c7d9f99.tar.bz2 |
QS60Style: Possible NULL pointer use when drawing frame
QS60Style::drawControl casts QStyleOption pointer to QStyleOptionFrame,
yet never checks if the orginal pointer was NULL or not. The casted
pointer is then used to fetch palette information from style option.
Thus, this might lead to crash.
Reviewed-by: Miikka Heikkinen
Diffstat (limited to 'src/gui/styles/qs60style.cpp')
-rw-r--r-- | src/gui/styles/qs60style.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index bafc5f3..3a01f3f 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2001,7 +2001,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, case CE_ShapedFrame: if (const QTextEdit *textEdit = qobject_cast<const QTextEdit *>(widget)) { const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(option); - if (QS60StylePrivate::canDrawThemeBackground(frame->palette.base(), widget)) + if (frame && QS60StylePrivate::canDrawThemeBackground(frame->palette.base(), widget)) QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_Editor, painter, option->rect, flags); else QCommonStyle::drawControl(element, option, painter, widget); |