fix: prevent nil pointer panic in gnutls probe when setup fails#879
Merged
Conversation
Move pcapFilter handling after the error check in MGnutlsProbe.start() to prevent nil pointer dereference when setupManagersPcap() fails. This aligns with the pattern used in probe_openssl.go and probe_gotls.go. Co-authored-by: cfc4n <709947+cfc4n@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix panic when BPF instruction not appointed
fix: prevent nil pointer panic in gnutls probe when setup fails
Nov 29, 2025
|
🔧 Debug Build Complete (PR 879, RunID 19784104104) 📦 Download Links: ⏰ Files will be retained for 7 days, please download and test promptly. |
cfc4n
requested changes
Dec 2, 2025
Move error check inside the switch case as requested by @cfc4n. Only access g.bpfManager.InstructionPatchers when err == nil. Co-authored-by: cfc4n <709947+cfc4n@users.noreply.github.com>
Member
|
@copilot 判断方式改为 如果err 不为nil,则抛出错误,停止执行。提示用户调整启动参数。 |
Changed from `if err == nil` to `if err != nil` pattern that returns an error immediately with a helpful message to check startup parameters. Co-authored-by: cfc4n <709947+cfc4n@users.noreply.github.com>
Contributor
Author
|
🔧 Debug Build Complete (PR 879, RunID 19859785993) 📦 Download Links: ⏰ Files will be retained for 7 days, please download and test promptly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Running
ecapture gnutls tls -m pcap --pcapfile save.pcapngpanics with nil pointer dereference instead of returning a proper error when the BPF manager setup fails.Root cause:
g.bpfManager.InstructionPatchersis accessed whensetupManagersPcap()returns an error.Summary of Changes:
if err != nilcheck inside theTlsCaptureModelTypePcapcase aftersetupManagersPcap()setupManagersPcap()failsOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.