Skip to content

Commit

Permalink
Merge branch 'main' into fix/oss-112-square-analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
kashifkhan0771 authored Feb 7, 2025
2 parents df890a3 + ad8fd36 commit bbc824b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ type Engine struct {
scanEntireChunk bool

// ahoCorasickHandler manages the Aho-Corasick trie and related keyword lookups.
ahoCorasickCore *ahocorasick.Core
AhoCorasickCore *ahocorasick.Core

// Engine synchronization primitives.
sourceManager *sources.SourceManager
Expand Down Expand Up @@ -524,7 +524,7 @@ func (e *Engine) initialize(ctx context.Context) error {
}

ctx.Logger().V(4).Info("setting up aho-corasick core")
e.ahoCorasickCore = ahocorasick.NewAhoCorasickCore(e.detectors, ahoCOptions...)
e.AhoCorasickCore = ahocorasick.NewAhoCorasickCore(e.detectors, ahoCOptions...)
ctx.Logger().V(4).Info("set up aho-corasick core")

return nil
Expand Down Expand Up @@ -789,7 +789,7 @@ func (e *Engine) scannerWorker(ctx context.Context) {
continue
}

matchingDetectors := e.ahoCorasickCore.FindDetectorMatches(decoded.Chunk.Data)
matchingDetectors := e.AhoCorasickCore.FindDetectorMatches(decoded.Chunk.Data)
if len(matchingDetectors) > 1 && !e.verificationOverlap {
wgVerificationOverlap.Add(1)
e.verificationOverlapChunksChan <- verificationOverlapChunk{
Expand Down
2 changes: 1 addition & 1 deletion pkg/engine/postman.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (e *Engine) ScanPostman(ctx context.Context, c sources.PostmanConfig) (sour

// Turn AhoCorasick keywordsToDetectors into a map of keywords
keywords := make(map[string]struct{})
for key := range e.ahoCorasickCore.KeywordsToDetectors() {
for key := range e.AhoCorasickCore.KeywordsToDetectors() {
keywords[key] = struct{}{}
}

Expand Down

0 comments on commit bbc824b

Please # to comment.