-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
winlogbeat/sys/wineventlog: fix unsafe pointer use #36650
Conversation
/test |
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
Fix the use of pointer to uintptr conversions to comply with the unsafe.Pointer rules. In particular, the code previously was not making conversions from a *T to uintptr in the call expression as required by rule (4) Conversion of a Pointer to a uintptr when calling syscall.Syscall[1]. [1]https://pkg.go.dev/unsafe#Pointer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
//sys _EvtRender(context EvtHandle, fragment EvtHandle, flags EvtRenderFlag, bufferSize uint32, buffer *byte, bufferUsed *uint32, propertyCount *uint32) (err error) = wevtapi.EvtRender | ||
//sys _EvtClose(object EvtHandle) (err error) = wevtapi.EvtClose | ||
//sys _EvtSeek(resultSet EvtHandle, position int64, bookmark EvtHandle, timeout uint32, flags uint32) (success bool, err error) [!success] = wevtapi.EvtSeek | ||
//sys _EvtNext(resultSet EvtHandle, eventArraySize uint32, eventArray *EvtHandle, timeout uint32, flags uint32, numReturned *uint32) (err error) = wevtapi.EvtNext | ||
//sys _EvtOpenChannelEnum(session EvtHandle, flags uint32) (handle EvtHandle, err error) = wevtapi.EvtOpenChannelEnum | ||
//sys _EvtNextChannelPath(channelEnum EvtHandle, channelPathBufferSize uint32, channelPathBuffer *uint16, channelPathBufferUsed *uint32) (err error) = wevtapi.EvtNextChannelPath | ||
//sys _EvtFormatMessage(publisherMetadata EvtHandle, event EvtHandle, messageID uint32, valueCount uint32, values uintptr, flags EvtFormatMessageFlag, bufferSize uint32, buffer *byte, bufferUsed *uint32) (err error) = wevtapi.EvtFormatMessage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was one of the first things I made in Go... long before I knew better. 😅
Will see what mergify gives me on 7.17. |
Fix the use of pointer to uintptr conversions to comply with the unsafe.Pointer rules. In particular, the code previously was not making conversions from a *T to uintptr in the call expression as required by rule (4) Conversion of a Pointer to a uintptr when calling syscall.Syscall[1]. [1]https://pkg.go.dev/unsafe#Pointer (cherry picked from commit 0ad4264) # Conflicts: # winlogbeat/sys/wineventlog/wineventlog_windows.go
Fix the use of pointer to uintptr conversions to comply with the unsafe.Pointer rules. In particular, the code previously was not making conversions from a *T to uintptr in the call expression as required by rule (4) Conversion of a Pointer to a uintptr when calling syscall.Syscall[1]. [1]https://pkg.go.dev/unsafe#Pointer (cherry picked from commit 0ad4264)
…r use (#36663) * winlogbeat/sys/wineventlog: fix unsafe pointer use (#36650) Fix the use of pointer to uintptr conversions to comply with the unsafe.Pointer rules. In particular, the code previously was not making conversions from a *T to uintptr in the call expression as required by rule (4) Conversion of a Pointer to a uintptr when calling syscall.Syscall[1]. [1]https://pkg.go.dev/unsafe#Pointer (cherry picked from commit 0ad4264) * remove irrelevant changelog line --------- Co-authored-by: Dan Kortschak <[email protected]>
…r use (#36662) * winlogbeat/sys/wineventlog: fix unsafe pointer use (#36650) Fix the use of pointer to uintptr conversions to comply with the unsafe.Pointer rules. In particular, the code previously was not making conversions from a *T to uintptr in the call expression as required by rule (4) Conversion of a Pointer to a uintptr when calling syscall.Syscall[1]. [1]https://pkg.go.dev/unsafe#Pointer (cherry picked from commit 0ad4264) # Conflicts: # winlogbeat/sys/wineventlog/wineventlog_windows.go * remove irrelevant changelog lines * resolve conflicts --------- Co-authored-by: Dan Kortschak <[email protected]> Co-authored-by: Dan Kortschak <[email protected]>
Fix the use of pointer to uintptr conversions to comply with the unsafe.Pointer rules. In particular, the code previously was not making conversions from a *T to uintptr in the call expression as required by rule (4) Conversion of a Pointer to a uintptr when calling syscall.Syscall[1]. [1]https://pkg.go.dev/unsafe#Pointer
Proposed commit message
Fix the use of pointer to uintptr conversions to comply with the unsafe.Pointer
rules. In particular, the code previously was not making conversions from a *T
to uintptr in the call expression as required by rule (4) Conversion of a
Pointer to a uintptr when calling syscall.Syscall[1].
[1]https://pkg.go.dev/unsafe#Pointer
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs