Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]

*Winlogbeat*

- Fix EvtVarTypeAnsiString conversion {pull}44026[44026]


*Elastic Logging Plugin*
Expand Down
5 changes: 4 additions & 1 deletion winlogbeat/sys/strings_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package sys

import (
"bytes"
"sync"

"golang.org/x/sys/windows"
Expand Down Expand Up @@ -48,6 +49,8 @@ func initANSIDecoder() *encoding.Decoder {
}

func ANSIBytesToString(enc []byte) (string, error) {
out, err := getCachedANSIDecoder().Bytes(enc)
// Trim to the null terminator
prefix, _, _ := bytes.Cut(enc, []byte("\x00"))
out, err := getCachedANSIDecoder().Bytes(prefix)
return string(out), err
}