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/src/backends/reference/workloads/StridedSlice.cpp b/src/backends/reference/workloads/StridedSlice.cpp
index c5fb121..68600c9 100644
--- a/src/backends/reference/workloads/StridedSlice.cpp
+++ b/src/backends/reference/workloads/StridedSlice.cpp
@@ -93,6 +93,15 @@
void* outputData,
unsigned int dataTypeSize)
{
+ if (inputData == nullptr)
+ {
+ throw armnn::InvalidArgumentException("Slice: Null inputData pointer");
+ }
+ if (outputData == nullptr)
+ {
+ throw armnn::InvalidArgumentException("Slice: Null outputData pointer");
+ }
+
const unsigned char* input = reinterpret_cast<const unsigned char*>(inputData);
unsigned char* output = reinterpret_cast<unsigned char*>(outputData);