From b45eb28099af0bb8e6e5307d527959428f742942 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Sat, 10 Jan 2015 13:17:50 +0300 Subject: [PATCH] Fix heap corruption. Closes #2342. Fix heap corruption during Registry access. --- src/preferences/preferences.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/preferences/preferences.cpp b/src/preferences/preferences.cpp index 4eeffa0ab..22ca38016 100644 --- a/src/preferences/preferences.cpp +++ b/src/preferences/preferences.cpp @@ -1394,7 +1394,7 @@ QString getRegValue(HKEY handle, const QString &name = QString()) delete[] lpValueName; if (res == ERROR_SUCCESS) { - lpData[cBuffer] = 0; + lpData[cBuffer - 1] = 0; result = QString::fromWCharArray(lpData); } delete[] lpData;