Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

fix(infra): strip the ansible.builtin. prefix without strlen on the offset

Martin Vogel5ca43266215d
diff --git a/src/pipeline/pass_ansible.c b/src/pipeline/pass_ansible.c
index 349619e38..4c1dff69d 100644
--- a/src/pipeline/pass_ansible.c
+++ b/src/pipeline/pass_ansible.c
@@ -151,8 +151,9 @@ static bool an_key(const an_t *a, TSNode pair, char *out, size_t sz) {
return false;
}
size_t bl = sizeof(BUILTIN) - SKIP_ONE;
- if (strncmp(out, BUILTIN, bl) == 0) {
- memmove(out, out + bl, strlen(out + bl) + SKIP_ONE);
+ size_t len = strlen(out);
+ if (len >= bl && memcmp(out, BUILTIN, bl) == 0) {
+ memmove(out, out + bl, len - bl + SKIP_ONE);
}
return true;
}