From 8dfca822e6a67f7f83a7ae3199e163e898d200f3 Mon Sep 17 00:00:00 2001
From: Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com>
Date: Fri, 1 May 2015 13:58:36 -0400
Subject: [PATCH] bookmark: Fix invalid memory access

Refs #72255
---
 src/categorizedbookmarkmodel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/categorizedbookmarkmodel.cpp b/src/categorizedbookmarkmodel.cpp
index 75ddb605..f86eadcd 100644
--- a/src/categorizedbookmarkmodel.cpp
+++ b/src/categorizedbookmarkmodel.cpp
@@ -336,7 +336,7 @@ QModelIndex CategorizedBookmarkModel::parent( const QModelIndex& idx) const
 ///Get the index
 QModelIndex CategorizedBookmarkModel::index(int row, int column, const QModelIndex& parent) const
 {
-   if (parent.isValid() && !column)
+   if (parent.isValid() && (!column) && d_ptr->m_lCategoryCounter.size() > parent.row() && d_ptr->m_lCategoryCounter[parent.row()]->m_lChildren.size() > row)
       return createIndex(row,column,(void*) static_cast<CategorizedCompositeNode*>(d_ptr->m_lCategoryCounter[parent.row()]->m_lChildren[row]));
    else if (row >= 0 && row < d_ptr->m_lCategoryCounter.size() && !column) {
       return createIndex(row,column,(void*) static_cast<CategorizedCompositeNode*>(d_ptr->m_lCategoryCounter[row]));
-- 
GitLab