aboutsummaryrefslogtreecommitdiff
path: root/profiling
diff options
context:
space:
mode:
Diffstat (limited to 'profiling')
-rw-r--r--profiling/common/src/SwTrace.cpp5
-rw-r--r--profiling/server/src/basePipeServer/BasePipeServer.cpp6
2 files changed, 10 insertions, 1 deletions
diff --git a/profiling/common/src/SwTrace.cpp b/profiling/common/src/SwTrace.cpp
index 5860d8cf06..c25baadfec 100644
--- a/profiling/common/src/SwTrace.cpp
+++ b/profiling/common/src/SwTrace.cpp
@@ -33,7 +33,10 @@ SwTraceMessage ReadSwTraceMessage(const unsigned char* packetBuffer,
unsigned int& offset,
const unsigned int& packetLength)
{
- ARM_PIPE_ASSERT(packetBuffer);
+ if (packetBuffer == nullptr)
+ {
+ throw ProfilingException("SwTrace.cpp: Attempting to read a null buffer");
+ }
unsigned int uint32_t_size = sizeof(uint32_t);
diff --git a/profiling/server/src/basePipeServer/BasePipeServer.cpp b/profiling/server/src/basePipeServer/BasePipeServer.cpp
index 81f58a5ee9..96e8e24a2c 100644
--- a/profiling/server/src/basePipeServer/BasePipeServer.cpp
+++ b/profiling/server/src/basePipeServer/BasePipeServer.cpp
@@ -207,6 +207,12 @@ bool BasePipeServer::SendPacket(uint32_t packetFamily, uint32_t packetId, const
// And the rest of the data if there is any.
if (dataLength > 0)
{
+ if (data == nullptr)
+ {
+ throw ProfilingException(
+ "basePipeServer: SendPacket: Attempting to send a non-zero length data packet with a null data pointer"
+ );
+ }
memcpy((packet.data() + 8), data, dataLength);
}
EchoPacket(PacketDirection::Sending, packet.data(), packet.size());