From b43743212e02b5fc8a0e0f316335f7700c8cdae5 Mon Sep 17 00:00:00 2001 From: Dave Corley Date: Sat, 22 Jun 2024 23:47:47 -0500 Subject: [PATCH] FIX: check we're not going out of range while listing content files, fix #8029 --- components/contentselector/model/contentmodel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/contentselector/model/contentmodel.cpp b/components/contentselector/model/contentmodel.cpp index ce34f30284..a1959d59f7 100644 --- a/components/contentselector/model/contentmodel.cpp +++ b/components/contentselector/model/contentmodel.cpp @@ -673,7 +673,8 @@ void ContentSelectorModel::ContentModel::setNonUserContent(const QStringList& fi file->setFromAnotherConfigFile(mNonUserContent.contains(file->fileName().toLower())); int insertPosition = 0; - while (mFiles.at(insertPosition)->builtIn()) + + while (insertPosition < mFiles.size() && mFiles.at(insertPosition)->builtIn()) ++insertPosition; for (const auto& filepath : fileList)