From ba00c500229671e54dfadf86f5b6dc7482a3f251 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Tue, 14 May 2024 16:09:16 +0200 Subject: [PATCH] avoid accessing a temp QString via QStringView after it is deleted Signed-off-by: Matthieu Gallien --- src/csync/csync_exclude.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/csync/csync_exclude.cpp b/src/csync/csync_exclude.cpp index 4d2c58cb326c8..a0411e7f5c3d4 100644 --- a/src/csync/csync_exclude.cpp +++ b/src/csync/csync_exclude.cpp @@ -134,9 +134,9 @@ static CSYNC_EXCLUDE_TYPE _csync_excluded_common(const QString &path, bool exclu { /* split up the path */ QStringView bname(path); - int lastSlash = path.lastIndexOf(QLatin1Char('/')); + int lastSlash = bname.lastIndexOf(QLatin1Char('/')); if (lastSlash >= 0) { - bname = path.mid(lastSlash + 1); + bname = bname.mid(lastSlash + 1); } qsizetype blen = bname.size();