Merge pull request #2006 from nspcc-dev/fix-diff-71613

vm: serialize `+` rune as `\u002B` for byte-contained stackitems
This commit is contained in:
Roman Khimov 2021-06-08 17:43:46 +03:00 committed by GitHub
commit 0a118cb476
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,6 +111,10 @@ func writeJSONString(w *io.BinWriter, it Item) {
return
}
data, _ := json.Marshal(s) // error never occurs because `ToString` checks for validity
// ref https://github.com/neo-project/neo-modules/issues/375 and https://github.com/dotnet/runtime/issues/35281
data = bytes.Replace(data, []byte{'+'}, []byte("\\u002B"), -1)
w.WriteBytes(data)
}