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

Function cbm_validate_shell_arg

src/foundation/str_util.c:246–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246bool cbm_validate_shell_arg(const char *s) {
247 if (!s) {
248 return false;
249 }
250 for (const char *p = s; *p; p++) {
251 switch (*p) {
252 case '\'':
253 case '"':
254 case ';':
255 case '|':
256 case '&':
257 case '$':
258 case '`':
259 case '<':
260 case '>':
261 case '\n':
262 case '\r':
263#ifndef _WIN32
264 case '\\':
265#endif
266 return false;
267 default:
268 break;
269 }
270 }
271 return true;
272}
273
274bool cbm_validate_shell_path_arg(const char *path) {
275 if (!cbm_validate_shell_arg(path)) {

Callers 4

handle_detect_changesFunction · 0.85
test_str_util.cFile · 0.85
test_security.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected