From 0023c870980564f0fe5d9decb25f6f2f3c99ffc4 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 6 Jun 2016 15:34:32 +0200 Subject: [PATCH] QmlProfiler: Don't add junk to the end of strings from QmlEvents The UTF-8 data stored in the event is not necessarily null-terminated. Change-Id: Id5d4f0b50f8c7c70aa6576121905072984f1c342 Reviewed-by: Christian Kandeler --- src/plugins/qmlprofiler/qmlevent.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmlprofiler/qmlevent.h b/src/plugins/qmlprofiler/qmlevent.h index 1f2fe202078..782df2a0f17 100644 --- a/src/plugins/qmlprofiler/qmlevent.h +++ b/src/plugins/qmlprofiler/qmlevent.h @@ -159,9 +159,9 @@ struct QmlEvent { { switch (m_dataType) { case External8Bit: - return QString::fromUtf8(static_cast(m_data.external)); + return QString::fromUtf8(static_cast(m_data.external), m_dataLength); case Inline8Bit: - return QString::fromUtf8(m_data.internalChar); + return QString::fromUtf8(m_data.internalChar, m_dataLength); default: Q_UNREACHABLE(); return QString();