These characters retain command-language meaning inside quoted cmd.exe * arguments: percent expands environment variables, exclamation can expand * delayed variables, and caret changes parsing. Never interpolate them from a * stored project root or request branch into the Windows detect_changes payload. * /V:OFF is defense in depth for exclamation; validation remains the boundary. */
| 9490 | * stored project root or request branch into the Windows detect_changes payload. |
| 9491 | * /V:OFF is defense in depth for exclamation; validation remains the boundary. */ |
| 9492 | static bool validate_windows_cmd_interpolation_arg(const char *s) { |
| 9493 | #ifdef _WIN32 |
| 9494 | return s && strpbrk(s, "%!^") == NULL; |
| 9495 | #else |
| 9496 | return s != NULL; |
| 9497 | #endif |
| 9498 | } |
| 9499 | |
| 9500 | static bool validate_search_args(const char *root_path, const char *file_pattern) { |
| 9501 | if (!validate_search_path_arg(root_path)) { |
no outgoing calls
no test coverage detected