Skip to content

Network: Perform a range check before using array offset - #163

Merged
RobertRostohar merged 1 commit into
mainfrom
codeql_fix2
Aug 20, 2026
Merged

Network: Perform a range check before using array offset#163
RobertRostohar merged 1 commit into
mainfrom
codeql_fix2

Conversation

@furbanc

@furbanc furbanc commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens several Network component loops by ensuring bounds checks are evaluated before array indexing, preventing potential out-of-range reads when inputs are not properly terminated or are truncated.

Changes:

  • Reordered short-circuit conditions to check index/limit before dereferencing buf[idx], passw[i], and sp[i].
  • Updated copyright headers to 2026 in the touched Network source files.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
Components/Network/Source/net_smtp_client_core.c Ensures the i < 64 bound is checked before reading passw[i] in HMAC-MD5 key preparation.
Components/Network/Source/net_dns_client.c Ensures idx < len is checked before reading buf[idx] when skipping an uncompressed DNS name.
Components/Network/Source/net_common.c Ensures i < nb is checked before reading sp[i] in net_strnchr.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@RobertRostohar
RobertRostohar merged commit c6eb145 into main Aug 20, 2026
5 checks passed
@RobertRostohar
RobertRostohar deleted the codeql_fix2 branch August 20, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants