Skip to content

Commit

Permalink
Fix coverity findings - add nullptr check before dereferencing (openv…
Browse files Browse the repository at this point in the history
…inotoolkit#10375)

Even though it is not possible to hit into this situation using existing plugins - there is theoretical possibility that some plugin may return 'nullptr' as it is allowed.
So this check shall remain in generic part which should not rely on plugin-specific behavior
  • Loading branch information
nosovmik authored Feb 15, 2022
1 parent dc905f9 commit d5e8e0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/inference/src/cpp/ie_infer_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ Blob::Ptr InferRequest::GetBlob(const std::string& name) {
Blob::Ptr blobPtr;
INFER_REQ_CALL_STATEMENT(blobPtr = _impl->GetBlob(name);)
std::string error = "Internal error: blob with name `" + name + "` is not allocated!";
const bool remoteBlobPassed = blobPtr->is<RemoteBlob>();
if (blobPtr == nullptr)
IE_THROW() << error;
const bool remoteBlobPassed = blobPtr->is<RemoteBlob>();
if (!remoteBlobPassed && blobPtr->buffer() == nullptr)
IE_THROW() << error;
return blobPtr;
Expand Down

0 comments on commit d5e8e0f

Please sign in to comment.