IVGCVSW-7901 Fix unsafe Usages of Memcpy in Armnn

* Updated usages of Memcpy to use proper checks for null instead of asserts
* Added error checking in places where none existed

Signed-off-by: David Monahan <david.monahan@arm.com>
Change-Id: I9529acd966466ba281f88918be2ec372a756e183
diff --git a/profiling/server/src/basePipeServer/BasePipeServer.cpp b/profiling/server/src/basePipeServer/BasePipeServer.cpp
index 81f58a5..96e8e24 100644
--- a/profiling/server/src/basePipeServer/BasePipeServer.cpp
+++ b/profiling/server/src/basePipeServer/BasePipeServer.cpp
@@ -207,6 +207,12 @@
     // 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());