Skip to content
Permalink
Browse files

Added null check on jit buffer.

  • Loading branch information...
nioroso-x3 committed May 12, 2019
1 parent 0e22168 commit d10b7383e640368c29deb4f3aeed7a34575dc75b
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/crypto/CryptonightR_JIT.c
@@ -140,7 +140,7 @@ int ppcJIT_load(void* execmem, uint32_t* code, uint64_t INST_LEN){
}
}
if(idx >= INST_LEN){
MERROR("JIT BUFFER FILLED UP!\n");
printf("JIT BUFFER FILLED UP!\n");
return -1;
}
for (idx = 0; code[idx] != 0x00000000; ++idx){
@@ -224,7 +224,11 @@ int v4_generate_JIT_code(const struct V4_Instruction* code, v4_random_math_JIT_f

return 0;
#elif defined __PPC__ || defined __PPC64__
MDEBUG("Started compiling PPC64 JIT at %p\n",buf);
if(buf == NULL){
printf("NULL BUFFER!\n");
return -1;
}
printf("Started compiling PPC64 JIT at %p\n",buf);
uint32_t* JIT_code = (uint32_t*) buf;
uint64_t INST_LEN = (uint64_t)(buf_size / sizeof(uint32_t));

0 comments on commit d10b738

Please sign in to comment.
You can’t perform that action at this time.