diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-08-15 13:57:06 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2013-08-15 15:28:42 +0200 |
commit | 4036d2b17795da106aba8977d3009b7dd4b78e00 (patch) | |
tree | 3dc85983c4a7d20814f16bdcc39c5a13f87ad912 /src/qml/compiler/qv4compiler.cpp | |
parent | 7b2c9178b93fc31779c05553dcc48930d66342e2 (diff) |
Fix valgrind errors in strings in compiled data
Make sure to include the zero terminator in the QString data.
Change-Id: Ie3c3b6a135b012a12a1d4de8bfb16cb8cf7d4615
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4compiler.cpp')
-rw-r--r-- | src/qml/compiler/qv4compiler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index 135c8679f1..6707283d93 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -146,7 +146,7 @@ QV4::CompiledData::Unit *QV4::Compiler::JSUnitGenerator::generateUnit() s->str.alloc = 0; s->str.capacityReserved = false; s->str.offset = sizeof(QArrayData); - memcpy(s + 1, qstr.constData(), qstr.length()*sizeof(ushort)); + memcpy(s + 1, qstr.constData(), (qstr.length() + 1)*sizeof(ushort)); string += QV4::CompiledData::String::calculateSize(qstr); } |