From 7154154e8aadaf40aa2f424c68b4bbe9b1a2f7d0 Mon Sep 17 00:00:00 2001 From: RJ Date: Fri, 2 Aug 2024 16:53:46 -0400 Subject: [PATCH] Prevent undefined behavior when using QString::chopped --- src/downloadlist.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/downloadlist.cpp b/src/downloadlist.cpp index e38d13fa0..bccf06ca2 100644 --- a/src/downloadlist.cpp +++ b/src/downloadlist.cpp @@ -221,7 +221,8 @@ QVariant DownloadList::data(const QModelIndex& index, int role) const .arg(info->modName) .arg(m_manager.getModID(index.row())) .arg(info->version.canonicalString()) - .arg(info->description.chopped(4096)); + .arg(info->description.size() > 4096 ? info->description.chopped(4096) + : info->description); } return text; }