From c135179c935e3f85e591014e14be81b3f2597825 Mon Sep 17 00:00:00 2001 From: Kevin May Date: Tue, 28 Jul 2020 11:29:04 +0100 Subject: 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 Change-Id: Ie15be8bc289d7bcb354a259312aada5268bff4e4 --- src/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp') diff --git a/src/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp b/src/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp index 74aefea142..5aac77c86a 100644 --- a/src/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp +++ b/src/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2019 Arm Ltd. All rights reserved. +// Copyright © 2019 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -40,7 +40,7 @@ void TimelineDirectoryCaptureCommandHandler::ParseData(const armnn::profiling::P for (uint32_t declaration = 0; declaration < numberOfDeclarations; ++declaration) { - m_SwTraceMessages.push_back(profiling::ReadSwTraceMessage(data, offset)); + m_SwTraceMessages.push_back(profiling::ReadSwTraceMessage(data, offset, packet.GetLength())); } m_TimelineCaptureCommandHandler.SetThreadIdSize(m_SwTraceHeader.m_ThreadIdBytes); -- cgit v1.2.1