Skip to content

sanitize_rfc1035: return early on error at start#6

Merged
rsmarples merged 1 commit intomasterfrom
sanitize
Apr 21, 2026
Merged

sanitize_rfc1035: return early on error at start#6
rsmarples merged 1 commit intomasterfrom
sanitize

Conversation

@rsmarples
Copy link
Copy Markdown
Member

Fixes a heap overflow found by runnint test with a sanitizer. Fixes #5

Fixes a heap overflow found by runnint test with a sanitizer.
Fixes #5
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ed510202-8ee6-4735-8035-9f865778a2a9

📥 Commits

Reviewing files that changed from the base of the PR and between 6d411f2 and a3ac70a.

📒 Files selected for processing (1)
  • src/common.c

Walkthrough

Modified sanitize_rfc1035() in src/common.c to return an error value immediately when an invalid condition is detected at the start of the input buffer, rather than continuing with sanitization steps.

Changes

Cohort / File(s) Summary
Heap overflow fix
src/common.c
Added early return statements in sanitize_rfc1035() to exit the function immediately when p == start triggers an error condition, preventing further buffer processing.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: returning early from sanitize_rfc1035 when an error occurs at the start of input.
Description check ✅ Passed The description relates to the changeset by referencing the heap overflow fix in sanitize_rfc1035 and linking to issue #5, which documents the overflow problem.
Linked Issues check ✅ Passed The PR addresses the heap-buffer-overflow in sanitize_rfc1035 reported in issue #5 by returning early on error at the start, preventing the overflow condition.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the heap overflow in sanitize_rfc1035 as required by issue #5; no out-of-scope modifications are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sanitize

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rsmarples rsmarples merged commit 8799c39 into master Apr 21, 2026
7 checks passed
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.

heap overflow in sanitize_rfc1035

1 participant