You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is a summary of compliance checks for this PR:
Security Compliance
⚪
Null pointer deref
Description: Possible null-pointer dereference/DoS: the new chained calls lateral->completionSettings()->mswCompletionParameters()->getSegmentIntervals() assume all pointers are non-null and occur before the later CVF_ASSERT(branch->wellPath()), so a crafted/invalid project state could crash the application during export. RicMswTableDataTools.cpp [201-205]
Referred Code
auto lateral = branch->wellPath();
auto intervals = lateral->completionSettings()->mswCompletionParameters()->getSegmentIntervals();
std::vector<std::pair<double, double>> segments =
RicMswTableDataTools::createSubSegmentMDPairs( startMD, endMD, maxSegmentLength, intervals );
Ticket Compliance
⚪
🎫 No ticket provided
Create ticket/issue
Codebase Duplication Compliance
⚪
Codebase context is not defined
Follow the guide to enable codebase context checks.
Custom Compliance
🟢
Generic: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis and compliance.
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful degradation
Status: Missing null checks: The new pointer chain dereferences lateral->completionSettings()->mswCompletionParameters() without validating intermediate pointers, risking crashes on null/absent settings.
Referred Code
auto lateral = branch->wellPath();
auto intervals = lateral->completionSettings()->mswCompletionParameters()->getSegmentIntervals();
std::vector<std::pair<double, double>> segments =
RicMswTableDataTools::createSubSegmentMDPairs( startMD, endMD, maxSegmentLength, intervals );
Generic: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent vulnerabilities
Status: Unvalidated external data: The PR now consumes segment interval data from completion settings without visible validation/sanitization of interval bounds or ordering, which may allow invalid geometry inputs unless guaranteed elsewhere.
Referred Code
auto lateral = branch->wellPath();
auto intervals = lateral->completionSettings()->mswCompletionParameters()->getSegmentIntervals();
std::vector<std::pair<double, double>> segments =
RicMswTableDataTools::createSubSegmentMDPairs( startMD, endMD, maxSegmentLength, intervals );
Why: The suggestion correctly identifies a potential null pointer dereference due to chained calls and a misplaced CVF_ASSERT. Adding assertions aligns with the existing coding style and prevents runtime crashes by ensuring pointers are valid before use.
Medium
More
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
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.
PR Type
Enhancement
Description
Refactor custom segment intervals retrieval from parameters
Move segment configuration UI section outside conditional block
Use well path completion settings to access segment intervals
Improve code organization and maintainability
Diagram Walkthrough
File Walkthrough
RicMswTableDataTools.cpp
Extract segment intervals from well path settingsApplicationLibCode/Commands/CompletionExportCommands/RicMswTableDataTools.cpp
RimCustomSegmentIntervalCollection.hcreateSubSegmentMDPairsinstead of customparameter
RimMswCompletionParameters.cpp
Relocate segment configuration UI sectionApplicationLibCode/ProjectDataModel/Completions/RimMswCompletionParameters.cpp
conditional block