diff options
author | Kevin May <kevin.may@arm.com> | 2020-07-28 11:29:04 +0100 |
---|---|---|
committer | Jim Flynn <jim.flynn@arm.com> | 2020-07-28 12:56:21 +0000 |
commit | c135179c935e3f85e591014e14be81b3f2597825 (patch) | |
tree | c75d688518c1b4573c5fdb9408eb738c9dba30e1 /tests/profiling/gatordmock | |
parent | 1a26896fd8d48205393ba0f22db864b5302b703f (diff) | |
download | armnn-c135179c935e3f85e591014e14be81b3f2597825.tar.gz |
IVGCVSW-5079 Fix for Timeline decoder segfaults when given bad data
* Check packet size/length in ReadSwTraceMessage
* Update existing Unit tests
* Add new Unit tests
Signed-off-by: Kevin May <kevin.may@arm.com>
Change-Id: Ie15be8bc289d7bcb354a259312aada5268bff4e4
Diffstat (limited to 'tests/profiling/gatordmock')
-rw-r--r-- | tests/profiling/gatordmock/tests/GatordMockTests.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/profiling/gatordmock/tests/GatordMockTests.cpp b/tests/profiling/gatordmock/tests/GatordMockTests.cpp index cefb7231de..e7eb0846c0 100644 --- a/tests/profiling/gatordmock/tests/GatordMockTests.cpp +++ b/tests/profiling/gatordmock/tests/GatordMockTests.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2017 Arm Ltd. All rights reserved. +// Copyright © 2017 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -158,7 +158,9 @@ void CheckTimelineDirectory(timelinedecoder::TimelineDirectoryCaptureCommandHand offset += uint32_t_size; for(uint32_t i = 0; i < declarationSize; ++i) { - swTraceBufferMessages.push_back(profiling::ReadSwTraceMessage(packetBuffer->GetReadableData(), offset)); + swTraceBufferMessages.push_back(profiling::ReadSwTraceMessage(packetBuffer->GetReadableData(), + offset, + packetBuffer->GetSize())); } for(uint32_t index = 0; index < declarationSize; ++index) |