fix: add nil check for opts in executeWithRuntime (#7248)#7285
fix: add nil check for opts in executeWithRuntime (#7248)#7285DrGalio wants to merge 1 commit intoprojectdiscovery:devfrom
Conversation
) Closes projectdiscovery#7248 Adds nil check before accessing opts.ExecutionId in executeWithRuntime, consistent with existing nil checks for opts.Callback and opts.Cleanup in the same function.
Neo - PR Security ReviewNo security issues found Highlights
Comment |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughFixed a missing nil check in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can disable poems in the walkthrough.Disable the |
themavik
left a comment
There was a problem hiding this comment.
test review from automation - please ignore
Summary
Adds a nil check before accessing
opts.ExecutionIdinexecuteWithRuntimeinpkg/js/compiler/pool.go.Problem
Line 115 accesses
opts.ExecutionIdwithout checking ifoptsis nil first:However, other accesses to
optsin the same function already perform nil checks:if opts != nil && opts.Cleanup != nilif opts != nil && opts.Callback != nilThis inconsistency means calling
executeWithRuntimewith a niloptswill panic.Fix
Wrap the
runtime.SetContextValuecall in anif opts != nilguard, consistent with the existing nil checks in the function.Changes
pkg/js/compiler/pool.go: Added nil check beforeopts.ExecutionIdaccessCloses #7248
Summary by CodeRabbit