summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/amd/amd_gpu/gpu.cpp
diff options
context:
space:
mode:
authorfireice-uk <fireice-uk@users.noreply.github.com>2017-10-10 18:01:16 +0100
committerGitHub <noreply@github.com>2017-10-10 18:01:16 +0100
commite79debcfcba699a5aaf3996e18338a2c0183bb0e (patch)
treead881049a730bc21f08b5116ae6da7f4cdb70ebe /xmrstak/backend/amd/amd_gpu/gpu.cpp
parent9af8d7f6ada328d88b53472f4527c848b538426d (diff)
parent611378eb968eeda5700fe257a27d87856aa112f0 (diff)
downloadxmr-stak-e79debcfcba699a5aaf3996e18338a2c0183bb0e.zip
xmr-stak-e79debcfcba699a5aaf3996e18338a2c0183bb0e.tar.gz
Merge pull request #23 from psychocrypt/fix-possibleIllegalMemoryAccessAMD
avoid possible illegal memory access
Diffstat (limited to 'xmrstak/backend/amd/amd_gpu/gpu.cpp')
-rw-r--r--xmrstak/backend/amd/amd_gpu/gpu.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/xmrstak/backend/amd/amd_gpu/gpu.cpp b/xmrstak/backend/amd/amd_gpu/gpu.cpp
index d43961e..ca81718 100644
--- a/xmrstak/backend/amd/amd_gpu/gpu.cpp
+++ b/xmrstak/backend/amd/amd_gpu/gpu.cpp
@@ -912,6 +912,10 @@ size_t XMRRunJob(GpuContext* ctx, cl_uint* HashOutput)
}
clFinish(ctx->CommandQueues);
+ auto & numHashValues = HashOutput[0xFF];
+ // avoid out of memory read, we have only storage for 0xFF results
+ if(numHashValues > 0xFF)
+ numHashValues = 0xFF;
ctx->Nonce += g_intensity;
return ERR_SUCCESS;
OpenPOWER on IntegriCloud