RDKB-67047: Apply null pointer safeguards in is_ValidIpAddressv6_port() - #135
Merged
Merged
Conversation
Reason for change: Apply null pointer safeguards to validate if the host name doesn't contain proper "[" and "]" tags. Test Procedure: Run " dmcli eRT setv Device.IPv6rd.InterfaceSetting.1.Alias string "[2001:0db8:85a3:0000:0000:8a2e:0370:7334" &" and make sure CcspPandMSsp process doesn't restart Risks: Low Priority: P1 Signed-off-by: Sivaraj_Sivalingam@comcast.com
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved blocking issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Adds null-pointer and allocation safeguards for malformed bracketed IPv6 host/port strings, preventing crashes during validation.
Changes:
- Handles allocation failures and cleanup.
- Rejects missing IPv6 tokens or closing brackets.
- Guards port-pointer access.
| File | Description |
|---|---|
source/util_api/ansc/AnscStringUtil/ansc_string_util.c |
Adds defensive validation and cleanup in IPv6 address/port parsing. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
hpatel006c
approved these changes
Sep 25, 2026
snayak002c
approved these changes
Sep 25, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Reason for change: Apply null pointer safeguards to validate if the host name doesn't contain proper "[" and "]" tags.
Test Procedure: Execute DML with invalid ipv6 format like missing "]" at end... e.g: " dmcli eRT setv Device.IPv6rd.InterfaceSetting.1.Alias string "[2001:0db8:85a3:0000:0000:8a2e:0370:7334" &" and make sure CcspPandMSsp process doesn't restart
Risks: Low
Priority: P1
Signed-off-by: Sivaraj_Sivalingam@comcast.com