MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / version_valid

Function version_valid

src/daemon/service.c:57–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57static bool version_valid(const char *version) {
58 size_t length = 0;
59 if (!bounded_length(version, CBM_DAEMON_VERSION_TEXT_SIZE, &length) || length == 0) {
60 return false;
61 }
62 /* Version text reaches stderr and a persistent JSON log. Keep it printable
63 * ASCII so an untrusted HELLO cannot inject terminal control sequences or
64 * malformed UTF-8 into either diagnostic channel. */
65 for (size_t i = 0; i < length; i++) {
66 unsigned char ch = (unsigned char)version[i];
67 if (ch < 0x20 || ch > 0x7e) {
68 return false;
69 }
70 }
71 return true;
72}
73
74static bool fingerprint_valid(const char *fingerprint) {
75 size_t length = 0;

Callers 3

identity_validFunction · 0.85
conflict_validFunction · 0.85
json_escape_versionFunction · 0.85

Calls 1

bounded_lengthFunction · 0.85

Tested by

no test coverage detected