From bac11f2cfe7913ef4c37af608454451e27f78eff Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Thu, 22 Jul 2021 13:03:16 +0200 Subject: x86-64: properly bounds-check %bnd in OP_G() The restriction to %bnd0-%bnd3 requires to also check REX.R is clear, just like OP_E_Register() also includes REX.B in its check. --- opcodes/i386-dis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'opcodes') diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index e95d2ef..203dcef 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -11966,7 +11966,7 @@ OP_G (int bytemode, int sizeflag) oappend (names64[modrm.reg + add]); break; case bnd_mode: - if (modrm.reg > 0x3) + if (modrm.reg + add > 0x3) { oappend ("(bad)"); return; -- cgit v1.1