Add a nil byte at the end of the itoa buffer,
before calling gostringnocopy. This prevents
gostringnocopy to read past the buffer size.
Change-Id: I87494a8dd6ea45263882536bf6c0f294eda6866d
Reviewed-on: https://go-review.googlesource.com/2033
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
} else {
// build error string
var tmp [32]byte
- status = []byte(gostringnocopy(&itoa(tmp[:], uint64(e))[0]) + "\x00")
+ status = []byte(gostringnocopy(&itoa(tmp[:len(tmp)-1], uint64(e))[0]))
}
goexitsall(&status[0])
exits(&status[0])