From 71281cbd395c613c7374d7ebd2dccc027c27e7ba Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Wed, 16 Oct 2024 09:01:56 +0200 Subject: [PATCH] prevent out of bounds access in automated tests Signed-off-by: Matthieu Gallien --- test/syncenginetestutils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/syncenginetestutils.cpp b/test/syncenginetestutils.cpp index 7671518be..39edfc653 100644 --- a/test/syncenginetestutils.cpp +++ b/test/syncenginetestutils.cpp @@ -501,7 +501,7 @@ FileInfo *FakePutReply::perform(FileInfo &remoteRootFileInfo, const QNetworkRequ fileInfo->contentChar = putPayload.at(0); } else { // Assume that the file is filled with the same character - fileInfo = remoteRootFileInfo.create(fileName, putPayload.size(), putPayload.at(0)); + fileInfo = remoteRootFileInfo.create(fileName, putPayload.size(), putPayload.isEmpty() ? ' ' : putPayload.at(0)); } fileInfo->lastModified = OCC::Utility::qDateTimeFromTime_t(request.rawHeader("X-OC-Mtime").toLongLong()); remoteRootFileInfo.find(fileName, /*invalidateEtags=*/true); -- 2.30.2