Browse Source
Merge pull request #6143 from lat9nq/nvhost_null_memcpy
nvhost_ctrl_gpu: Avoid sending null pointer to memcpy
pull/15/merge
bunnei
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
1 deletions
-
src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp
|
|
|
@ -248,7 +248,13 @@ NvResult nvhost_ctrl_gpu::ZBCSetTable(const std::vector<u8>& input, std::vector< |
|
|
|
IoctlZbcSetTable params{}; |
|
|
|
std::memcpy(¶ms, input.data(), input.size()); |
|
|
|
// TODO(ogniK): What does this even actually do?
|
|
|
|
std::memcpy(output.data(), ¶ms, output.size()); |
|
|
|
|
|
|
|
// Prevent null pointer being passed as arg 1
|
|
|
|
if (output.empty()) { |
|
|
|
LOG_WARNING(Service_NVDRV, "Avoiding passing null pointer to memcpy"); |
|
|
|
} else { |
|
|
|
std::memcpy(output.data(), ¶ms, output.size()); |
|
|
|
} |
|
|
|
return NvResult::Success; |
|
|
|
} |
|
|
|
|
|
|
|
|