diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2017-09-14 14:23:25 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2017-09-29 13:31:44 +0000 |
commit | c54397c25c00caaaed1b3cd360a73542950be77e (patch) | |
tree | bb8b610b37da39fa19ea4b89d11c11f72eeab6d9 | |
parent | bce521e07cbbd83da81649f7bf064fa6fe87673f (diff) |
Truncate stack snapshots to the size given
There is no reason to carry around junk data and possibly analyze it.
Change-Id: I0ea56270efe6382f0c16de703b32405c4388f00a
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
-rw-r--r-- | app/perfdata.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/perfdata.cpp b/app/perfdata.cpp index 98b0132..1305d21 100644 --- a/app/perfdata.cpp +++ b/app/perfdata.cpp @@ -561,6 +561,10 @@ QDataStream &operator>>(QDataStream &stream, PerfRecordSample &record) quint64 contentSize; stream >> contentSize; + if (contentSize > sectionSize) + qWarning() << "Truncated stack snapshot" << contentSize << sectionSize; + else + record.m_userStack.resize(static_cast<int>(contentSize)); } if (sampleType & PerfEventAttributes::SAMPLE_WEIGHT) |