Skip to content

Commit

Permalink
Replace strncpy with memcpy because we copy from larger to smaller bu…
Browse files Browse the repository at this point in the history
…ffer.
  • Loading branch information
Rot127 committed May 27, 2023
1 parent b301789 commit 9792718
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/PowerPC/PPCInstPrinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ void PPC_printInst(MCInst *MI, SStream *O, void *Info)
mnem_len = sizeof(MI->flat_insn->mnemonic) - 1;

memset(MI->flat_insn->mnemonic, 0, sizeof(MI->flat_insn->mnemonic));
strncpy(MI->flat_insn->mnemonic, O->buffer, mnem_len);
memcpy(MI->flat_insn->mnemonic, O->buffer, mnem_len);
}

// FIXME
Expand Down

0 comments on commit 9792718

Please sign in to comment.