Fix nil pointer dereference in toComDetails when port parsing fails#491
Fix nil pointer dereference in toComDetails when port parsing fails#491sebrandon1 wants to merge 1 commit into
Conversation
|
/retest commatrix-e2e-tests-1of2 |
|
/retest commatrix-e2e-tests-2of2 |
|
/retest |
10 similar comments
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/lgtm |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: oribon, sebrandon1 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
1 similar comment
|
/retest |
parseComDetail returns nil when strconv.Atoi fails on the port string, but the caller dereferences the result without a nil check, causing a panic. Add a nil guard to skip unparseable ss entries.
d2643d0 to
d30e9af
Compare
|
New changes are detected. LGTM label has been removed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds a defensive nil-check in the Nil-check in parseComDetail flow
🎯 2 (Simple) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions 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 |
Summary
parseComDetail()returnsnilwhenstrconv.Atoifails on the port string, buttoComDetails()dereferences the result at*cdwithout a nil check, causing a panicparseComDetailalready records the failureTest plan