From 120eff92f725b1ca45aab5e87006e306d4a13aa4 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 22 Jul 2020 14:58:27 +0300 Subject: [PATCH] core: adjust System.Runtime.Notify interop Part of #1198. Notification name should be UTF8-encoded. --- pkg/core/interop_system.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/core/interop_system.go b/pkg/core/interop_system.go index fd0fb96e8..9786cdaf9 100644 --- a/pkg/core/interop_system.go +++ b/pkg/core/interop_system.go @@ -253,6 +253,9 @@ func runtimeNotify(ic *interop.Context, v *vm.VM) error { if len(name) > MaxEventNameLen { return fmt.Errorf("event name must be less than %d", MaxEventNameLen) } + if !utf8.Valid(name) { + return errors.New("event name should be UTF8-encoded") + } elem := v.Estack().Pop() args := elem.Array() // But it has to be serializable, otherwise we either have some broken