Data corruption

#5 · open · 1 comments

View on GitHub ↗

Harwayne

https://github.com/sbezverk/syslog2cloud/blob/ecd07a0acbecc7bef2fb940b214af9a94655bc27/pkg/syslog/server.go#L46 I _think_ `buffer[:n]` will essentially pass by reference, so the next iteration of this loop may overwrite the values before `transferSysLogMsg` sees them. Concretely (as I understand it), the slice is copied and pass by value, but the slice struct contains pointers to an array, not the actual contents, so the slice's content is essentially pass by value. https://blog.golang.org/go-slices-usage-and-internals

Comments

sbezverk

Addressed by: https://github.com/sbezverk/syslog2cloud/commit/c039815f08e900d16a1b4633ed8d84616d95fe71