Files
codeql/cpp/ql/src/Security/CWE/CWE-134/UncontrolledFormatString.c
2018-08-02 17:53:23 +01:00

16 lines
278 B
C

#include <stdio.h>
void printWrapper(char *str) {
printf(str);
}
int main(int argc, char **argv) {
// This should be avoided
printf(argv[1]);
// This should be avoided too, because it has the same effect
printWrapper(argv[1]);
// This is fine
printf("%s", argv[1]);
}