Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2021-01-18 17:01:21 +0300
committerHannah von Reth <vonreth@kde.org>2021-01-19 00:47:47 +0300
commitefe18f3afafe392256988ac28958a5f259c7083d (patch)
treef4acd15de34f87758b633285409715c84920ca59 /src
parentb0951798abd391537914b2ca9ee71008f1c1085d (diff)
Add workaround for issue discovered in https://github.com/owncloud/core/pull/38304
Diffstat (limited to 'src')
-rw-r--r--src/common/checksums.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/common/checksums.cpp b/src/common/checksums.cpp
index aceb4cb36..7363f8a31 100644
--- a/src/common/checksums.cpp
+++ b/src/common/checksums.cpp
@@ -153,8 +153,13 @@ QByteArray findBestChecksum(const QByteArray &_checksums)
|| -1 != (i = checksums.indexOf(QLatin1String("MD5:"), Qt::CaseInsensitive))
|| -1 != (i = checksums.indexOf(QLatin1String("ADLER32:"), Qt::CaseInsensitive))) {
// Now i is the start of the best checksum
- // Grab it until the next space or end of string.
- return _checksums.mid(i, _checksums.indexOf(' ', i) - i);
+ // Grab it until the next space or end of xml or end of string.
+ int end = _checksums.indexOf(' ', i);
+ // workaround for https://github.com/owncloud/core/pull/38304
+ if (end == -1) {
+ end = _checksums.indexOf('<', i);
+ }
+ return _checksums.mid(i, end - i);
}
qCWarning(lcChecksums) << "Failed to parse" << _checksums;
return QByteArray();