Skip to content

fix(orchestrator): add bounds check for offset in cloud_orchestrator.zig parsing#175

Merged
gHashTag merged 1 commit into
mainfrom
feat/issue-174
Mar 11, 2026
Merged

fix(orchestrator): add bounds check for offset in cloud_orchestrator.zig parsing#175
gHashTag merged 1 commit into
mainfrom
feat/issue-174

Conversation

@gHashTag
Copy link
Copy Markdown
Owner

Summary

  • Added bounds check @min(sid_end + 1, content.len) in the JSON parsing loop to prevent out-of-bounds memory access

Changes

  • In src/tri/cloud_orchestrator.zig line 286, changed offset = sid_end + 1 to offset = @min(sid_end + 1, content.len)

Root Cause

When parsing JSON to find issue/service_id pairs, if sid_end equals content.len, then sid_end + 1 would be out-of-bounds. This could cause undefined behavior in the next iteration's indexOfPos call.

Test Plan

  • Code compiles (no new errors introduced)
  • zig fmt passes

Closes #174

🤖 Generated with Claude Code

…zig parsing (#174)

Added @min(sid_end + 1, content.len) to prevent out-of-bounds memory
access when sid_end equals content.len in the JSON parsing loop.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gHashTag gHashTag merged commit 99a55af into main Mar 11, 2026
4 of 6 checks passed
gHashTag added a commit that referenced this pull request Mar 18, 2026
fix(orchestrator): add bounds check for offset in cloud_orchestrator.zig parsing
@gHashTag gHashTag deleted the feat/issue-174 branch April 3, 2026 11:00
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.

fix(orchestrator): add bounds check for offset in cloud_orchestrator.zig parsing

1 participant