[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bcalligra=5D_libs/textlayout=3A_Fix_invalid_read=2E?=
From:       Thorsten Zachmann <t.zachmann () zagge ! de>
Date:       2011-06-12 4:21:30
Message-ID: 20110612042130.7F6DFA60A6 () git ! kde ! org
[Download RAW message or body]

Git commit f4d4b0fcc87ac85d5f4c6f246f4da3ca06bae7be by Thorsten Zachmann.
Committed on 12/06/2011 at 06:16.
Pushed by zachmann into branch 'master'.

Fix invalid read.

First check if object is valid before using it.

M  +1    -1    libs/textlayout/KoTextLayoutTableArea.cpp     

http://commits.kde.org/calligra/f4d4b0fcc87ac85d5f4c6f246f4da3ca06bae7be

diff --git a/libs/textlayout/KoTextLayoutTableArea.cpp b/libs/textlayout/KoTextLayoutTableArea.cpp
index f8fead5..01f05d0 100644
--- a/libs/textlayout/KoTextLayoutTableArea.cpp
+++ b/libs/textlayout/KoTextLayoutTableArea.cpp
@@ -774,7 +774,7 @@ void KoTextLayoutTableArea::paintCell(QPainter *painter, const KoTextDocumentLay
         QTextTableCell startTableCell = d->table->cellAt(selection.cursor.selectionStart());
         QTextTableCell endTableCell = d->table->cellAt(selection.cursor.selectionEnd());
 
-        if (startTableCell != endTableCell && startTableCell.isValid()) {
+        if (startTableCell.isValid() && startTableCell != endTableCell) {
             int selectionRow;
             int selectionColumn;
             int selectionRowSpan;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic