Files
codebase-memory-mcp/tests
Andrew Hundt 8d0816db67 fix(depindex): bound invalid automatic dependency limits
Define CBM_MAX_AUTO_DEP_LIMIT in src/depindex/depindex.h and route src/depindex/depindex.c plus src/mcp/mcp.c through cbm_dep_normalize_configured_limit. Values 1..10000 remain caps, 0 remains unlimited, and negative or oversized legacy/internal values fall back to CBM_DEFAULT_AUTO_DEP_LIMIT instead of becoming unbounded.

Parse config integers through cbm_config_parse_decimal_int in src/cli/cli.c so ERANGE and values outside INT_MIN..INT_MAX return the caller default rather than narrowing to int. Reject persisted auto_dep_limit values outside 0..10000, derive the registry range and MCP schema maximum from CBM_MAX_AUTO_DEP_LIMIT, and cover the boundaries in tests/test_cli.c, tests/test_depindex.c, and tests/test_mcp.c.

Verified: cli 243 passed; depindex 40 passed; mcp 273 passed; bash scripts/check-source-safety.sh passed; git diff --check passed.
Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
2026-07-22 16:55:05 -04:00
..
2026-07-08 00:05:19 +05:30