// gt-0013: Ifdef-excluded code path // Expected: UNREACHABLE (tier: imported) // Vulnerability: CWE-78 (OS Command Injection) // Compile with: gcc -DPRODUCTION main.c (LEGACY_SHELL not defined) #include #include #include #define PRODUCTION void process_command(const char *cmd) { #ifdef LEGACY_SHELL // This code is excluded when LEGACY_SHELL is not defined system(cmd); // SINK: CWE-78 (but unreachable - ifdef excluded) #else // Safe path: just print, don't execute printf("Would execute: %s\n", cmd); #endif } int main(int argc, char *argv[]) { if (argc > 1) { process_command(argv[1]); } return 0; }