Skip to content

Commit c406bd9

Browse files
Trinity Agentclaude
andcommitted
fix(orchestrator): add bounds check for offset in cloud_orchestrator.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>
1 parent c16ed8f commit c406bd9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/tri/cloud_orchestrator.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ fn loadState() void {
283283
entry.service_id_len = @min(sid.len, 128);
284284
@memcpy(entry.service_id[0..entry.service_id_len], sid[0..entry.service_id_len]);
285285
agent_count += 1;
286-
offset = sid_end + 1;
286+
offset = @min(sid_end + 1, content.len);
287287
}
288288
}
289289

0 commit comments

Comments
 (0)