Merge pull request #1241 from nspcc-dev/fix/string

Ensure strings are valid UTF-8 where appropriate
This commit is contained in:
Roman Khimov 2020-08-03 18:10:27 +03:00 committed by GitHub
commit 00671deb8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 68 additions and 46 deletions

View file

@ -205,7 +205,7 @@ func runtimeEncode(_ *interop.Context, v *vm.VM) error {
// runtimeDecode decodes top stack item from base64 string to byte array.
func runtimeDecode(_ *interop.Context, v *vm.VM) error {
src := string(v.Estack().Pop().Bytes())
src := v.Estack().Pop().String()
result, err := base64.StdEncoding.DecodeString(src)
if err != nil {
return err