mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
C++: Add test with missing flow through 'fopen'.
This commit is contained in:
@@ -6584,6 +6584,15 @@ WARNING: module 'TaintTracking' has been deprecated and may be removed in future
|
||||
| taint.cpp:767:21:767:24 | ref arg path | taint.cpp:768:8:768:11 | path | |
|
||||
| taint.cpp:768:8:768:11 | path | taint.cpp:768:7:768:11 | * ... | |
|
||||
| taint.cpp:778:37:778:42 | call to source | taint.cpp:779:7:779:9 | obj | |
|
||||
| taint.cpp:785:23:785:28 | source | taint.cpp:785:23:785:28 | source | |
|
||||
| taint.cpp:785:23:785:28 | source | taint.cpp:786:18:786:23 | source | |
|
||||
| taint.cpp:785:23:785:28 | source | taint.cpp:790:15:790:20 | source | |
|
||||
| taint.cpp:786:12:786:16 | call to fopen | taint.cpp:787:7:787:7 | f | |
|
||||
| taint.cpp:789:8:789:9 | f2 | taint.cpp:790:11:790:12 | f2 | |
|
||||
| taint.cpp:789:8:789:9 | f2 | taint.cpp:791:7:791:8 | f2 | |
|
||||
| taint.cpp:790:10:790:12 | ref arg & ... | taint.cpp:790:11:790:12 | f2 [inner post update] | |
|
||||
| taint.cpp:790:10:790:12 | ref arg & ... | taint.cpp:791:7:791:8 | f2 | |
|
||||
| taint.cpp:790:11:790:12 | f2 | taint.cpp:790:10:790:12 | & ... | |
|
||||
| vector.cpp:16:43:16:49 | source1 | vector.cpp:17:26:17:32 | source1 | |
|
||||
| vector.cpp:16:43:16:49 | source1 | vector.cpp:31:38:31:44 | source1 | |
|
||||
| vector.cpp:17:21:17:33 | call to vector | vector.cpp:19:14:19:14 | v | |
|
||||
|
||||
@@ -777,4 +777,16 @@ TaintInheritingContentObject source(bool);
|
||||
void test_TaintInheritingContent() {
|
||||
TaintInheritingContentObject obj = source(true);
|
||||
sink(obj.flowFromObject); // $ ir MISSING: ast
|
||||
}
|
||||
|
||||
FILE* fopen(const char*, const char*);
|
||||
int fopen_s(FILE** pFile, const char *filename, const char *mode);
|
||||
|
||||
void fopen_test(char* source) {
|
||||
FILE* f = fopen(source, "r");
|
||||
sink(f); // $ MISSING: ast,ir
|
||||
|
||||
FILE* f2;
|
||||
fopen_s(&f2, source, "r");
|
||||
sink(f2); // $ ast MISSING: ir
|
||||
}
|
||||
Reference in New Issue
Block a user