Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[receiver/windowseventlog] Fix panic when rendering excessively long …
…offset (open-telemetry#36179) A user observed a panic in the receiver after updating to v0.112.0, where rendering info is expanded by default: ``` goroutine 69 [running]: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/input/windows.(*Buffer).ReadBytes(0x37?, 0x19?) C:/Users/runneradmin/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.112.0/operator/input/windows/buffer.go:26 +0x165 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/input/windows.(*Buffer).ReadWideChars(...) C:/Users/runneradmin/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.112.0/operator/input/windows/buffer.go:37 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/input/windows.(*Event).RenderDeep(0xc002aaf998, {{0xc003120000, 0x4000, 0x4000}}, {0x8c1b918?}) C:/Users/runneradmin/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.112.0/operator/input/windows/event.go:117 +0x155 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/input/windows.(*Input).renderDeepAndSend(0xc001ee3dc0, {0x9977160, 0xc00312c460}, {0x19}, {0x13b480ccd58?}) ``` @pjanotti This is a quick fix to avoid the panic by reading the full buffer, but not trying to read more. There may be a better behavior than this but I am not familiar with how the buffer size is established so am proposing to just read the full content for now.
- Loading branch information