arch/X86: fix strncpy usage (#1243)
The `n` parameter should be the size of the destination buffer, not the source one.
This commit is contained in:
parent
67b9a2174f
commit
5212dc571a
|
@ -881,7 +881,7 @@ void X86_ATT_printInst(MCInst *MI, SStream *OS, void *info)
|
|||
|
||||
// perhaps this instruction does not need printer
|
||||
if (MI->assembly[0]) {
|
||||
strncpy(OS->buffer, MI->assembly, sizeof(MI->assembly));
|
||||
strncpy(OS->buffer, MI->assembly, sizeof(OS->buffer));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -742,7 +742,7 @@ void X86_Intel_printInst(MCInst *MI, SStream *O, void *Info)
|
|||
|
||||
// perhaps this instruction does not need printer
|
||||
if (MI->assembly[0]) {
|
||||
strncpy(O->buffer, MI->assembly, sizeof(MI->assembly));
|
||||
strncpy(O->buffer, MI->assembly, sizeof(O->buffer));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue