Added a zero byte at the end of strings

This commit is contained in:
Eduard Urbach 2025-02-09 15:37:00 +01:00
parent a24b8a7586
commit abd19903ec
Signed by: eduard
GPG key ID: 49226B848C78F6C8
2 changed files with 4 additions and 3 deletions

View file

@ -48,7 +48,7 @@ func (f *Function) TokenToRegister(t token.Token, register cpu.Register) (types.
data := t.Bytes(f.File.Bytes)
data = String(data)
slice := make([]byte, len(data)+8)
slice := make([]byte, len(data)+8+1)
binary.LittleEndian.PutUint64(slice, uint64(len(data)))
copy(slice[8:], data)