From e5f6d5acfa1c2ea733f46a248f3127ed0abd41e4 Mon Sep 17 00:00:00 2001 From: David Given Date: Thu, 16 May 2013 22:02:59 +0100 Subject: [PATCH] Fix buffer overrun looking up type information for op_lab pseudoops (as they're not EM opcodes, we shouldn't look them up in em_flags!). --- mach/proto/ncg/nextem.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mach/proto/ncg/nextem.c b/mach/proto/ncg/nextem.c index 9023f8a22..75f0d0fec 100644 --- a/mach/proto/ncg/nextem.c +++ b/mach/proto/ncg/nextem.c @@ -87,6 +87,13 @@ extern char em_flag[]; argtyp(mn) { + /* op_lab is a special opcode which represents a label definition. It's + * not actually a real EM instruction. Therefore if we try to look it + * up in em_flag, we'll get a buffer overrun... */ + + if (mn == op_lab) + return EV_UNDEF; + switch(em_flag[mn-sp_fmnem]&EM_PAR) { case PAR_W: case PAR_S: -- 2.34.1