================
@@ -1396,3 +1397,14 @@ void testAcceptPropagates() {
int acceptSocket = accept(listenSocket, 0, 0);
clang_analyzer_isTainted_int(acceptSocket); // expected-warning {{YES}}
}
+
+int main(int argc, char * argv[]) {
+ if (argc < 2)
+ return 1;
+ char cmd[2048] = "/bin/cat ";
+ clang_analyzer_isTainted_char(*argv[1]); // expected-warning{{YES}}
+ strncat(cmd, argv[1], sizeof(cmd) - strlen(cmd)-1);
+ system(cmd);// expected-warning {{Untrusted data is passed to a system
call}}
+ return 0;
+ }
+
----------------
steakhal wrote:
```suggestion
```
This trailing whitespace actually suggests to me that this file wasn't
clang-formatted. :(
https://github.com/llvm/llvm-project/pull/178054
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits