]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libcpu: riscv_disasm use 50 char mnebuf
authorMark Wielaard <mark@klomp.org>
Mon, 2 Jun 2025 23:50:07 +0000 (01:50 +0200)
committerMark Wielaard <mark@klomp.org>
Tue, 3 Jun 2025 11:44:54 +0000 (13:44 +0200)
commit07bd923cea4b883ca2357e9fc80babcedd242b37
tree7c4b6a110e6dd0b0c91f1cf0230a7c3563a2c26b
parentec21fbb47e48d954835fe6ced9eed555a3e73e9f
libcpu: riscv_disasm use 50 char mnebuf

Some "illegal" instructions can be up to 24 chars (192 bits), We'll
print this as 0x<48 hex chars>. So make sure the mnebuf is 50 chars
(no terminating zero is needed).

This shows up with _FORTIFY_SOURCE which would immediate terminate on
such "illegal" instructions. Without we just use a few extra bytes on
the stack (which aren't used afterwards, without any issue, even
though it is technically UB).

* libcpu/riscv_disasm.c (riscv_disasm): Extend char mnebuf
        array to 50.

Signed-off-by: Mark Wielaard <mark@klomp.org>
libcpu/riscv_disasm.c