summaryrefslogtreecommitdiffstats
path: root/src/core/web_engine_library_info.cpp
diff options
context:
space:
mode:
authorMichael BrĂ¼ning <michael.bruning@qt.io>2021-01-18 23:15:45 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-01-22 14:05:27 +0000
commit9841acdec527749c37f845c5dc6a94a1a4ab3357 (patch)
tree53d529cb8be3edd1d04d4db3e091696115874ddc /src/core/web_engine_library_info.cpp
parenta134b801dc38feb536d4829213624dba72702d54 (diff)
Leave room for the null-termination byte when checking remote drive path
The implementation could lead to heap corruption because the drive letter string was not large enough for the drive letter plus the null- termination byte. Original patch by Tamas Karpati. Change-Id: I012057c48b071a453ef8cda926041d3e9db78555 Fixes: QTBUG-90347 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 3fb215dab139fd7b61473ce3fe1058b87a6b4fe3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/core/web_engine_library_info.cpp')
-rw-r--r--src/core/web_engine_library_info.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
index 30d20c87a..2ad5b7565 100644
--- a/src/core/web_engine_library_info.cpp
+++ b/src/core/web_engine_library_info.cpp
@@ -370,7 +370,7 @@ std::string WebEngineLibraryInfo::getApplicationLocale()
#if defined(OS_WIN)
bool WebEngineLibraryInfo::isRemoteDrivePath(const QString &path)
{
- WCHAR wDriveLetter[3];
+ WCHAR wDriveLetter[4] = { 0 };
swprintf(wDriveLetter, L"%S", path.mid(0, 3).toStdString().c_str());
return GetDriveType(wDriveLetter) == DRIVE_REMOTE;
}