From 06a0de3567076f50f95be92fe026dab4dfe7b262 Mon Sep 17 00:00:00 2001 From: Sarbojit Sarkar Date: Wed, 20 May 2020 03:50:36 -0400 Subject: [PATCH] added null check Change-Id: I7631965286bad5684bacb7e38c63031b5c691dc0 --- hipamd/rocclr/hip_memory.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hipamd/rocclr/hip_memory.cpp b/hipamd/rocclr/hip_memory.cpp index df331ea9ad..3aad7f57ba 100755 --- a/hipamd/rocclr/hip_memory.cpp +++ b/hipamd/rocclr/hip_memory.cpp @@ -110,6 +110,9 @@ hipError_t ihipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKin // Skip if nothing needs writing. return hipSuccess; } + if (dst == nullptr || src == nullptr) { + return hipErrorInvalidValue; + } amd::Command* command = nullptr; amd::Command::EventWaitList waitList;