Skip to content

Commit

Permalink
[8.18](backport #42682) x-pack/filebeat/input/entityanalytics/provide…
Browse files Browse the repository at this point in the history
…r/activedirectory: fix use before init bug (#42700)

* x-pack/filebeat/input/entityanalytics/provider/activedirectory: fix use before init bug (#42682)

The transaction tracker was not being initialised until after the first
call to publishMarker in runFullSync, resulting in a nil pointer
deference when the the tracker Add method is called.

(cherry picked from commit 1473ae9)

* remove irrelevant changelog entry

---------

Co-authored-by: Dan Kortschak <[email protected]>
  • Loading branch information
mergify[bot] and efd6 authored Feb 13, 2025
1 parent 6b32d89 commit 708fec8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ otherwise no tag is added. {issue}42208[42208] {pull}42403[42403]
- In the `streaming` input, prevent panics on shutdown with a null check and apply a consistent namespace to contextual data in debug logs. {pull}42315[42315]
- Remove erroneous status reporting to Elastic-Agent from the Filestream input {pull}42435[42435]
- Fix truncation of bodies in request tracing by limiting bodies to 10% of the maximum file size. {pull}42327[42327]
- Fix entityanalytics activedirectory provider full sync use before initialization bug. {pull}42682[42682]

*Heartbeat*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,9 @@ func (p *adInput) runFullSync(inputCtx v2.Context, store *kvstore.Store, client
}
}
if len(users) != 0 {
var tracker *kvstore.TxTracker
start := time.Now()
tracker := kvstore.NewTxTracker(ctx)
p.publishMarker(start, start, inputCtx.ID, true, client, tracker)
tracker = kvstore.NewTxTracker(ctx)
for _, u := range users {
p.publishUser(u, state, inputCtx.ID, client, tracker)
}
Expand Down

0 comments on commit 708fec8

Please sign in to comment.