Files
codeql/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/printf.cpp

12 lines
249 B
C++

int printf(const char * format, ...);
void test_printf(const char * fmt1, bool choice, const char * str) {
printf("%s", str);
printf(fmt1, str);
printf(choice ? "%s" : "%s\n", str);
return;
printf("%s", str); // Unreachable
}