Skip to content

Commit

Permalink
Merge pull request #6751 from nextcloud/bugfix/fixWrongMemoryAccessIn…
Browse files Browse the repository at this point in the history
…ExcludeFiles

avoid accessing a temp QString via QStringView after it is deleted
  • Loading branch information
mgallien authored May 15, 2024
2 parents 62661b7 + ba00c50 commit 1b9fbb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/csync/csync_exclude.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 1b9fbb0

Please sign in to comment.