diff options
| author | bunnei <bunneidev@gmail.com> | 2021-04-07 16:50:22 -0700 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-07 16:50:22 -0700 | 
| commit | 262a70223f0ef9a7cce2f8106e70401fba477e19 (patch) | |
| tree | 4d225ed6a11ea0984387a973d47793729264c5f8 /src/core/hle | |
| parent | 535e50db1c7fa67402d32b8a910f0431becd095e (diff) | |
| parent | 638c892edf806837702f80ad5a0e57da0c8dbabe (diff) | |
Merge pull request #6143 from lat9nq/nvhost_null_memcpy
nvhost_ctrl_gpu: Avoid sending null pointer to memcpy
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp index 933d42f3f..2edd803f3 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp +++ b/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;  } | 
