repo
stringlengths
1
152
file
stringlengths
14
221
code
stringlengths
501
25k
file_length
int64
501
25k
avg_line_length
float64
20
99.5
max_line_length
int64
21
134
extension_type
stringclasses
2 values
codeql
codeql-master/cpp/ql/test/library-tests/multiple_declarations/variable_types/file1.c
// These typedefs are all _compatible_ (see // https://en.cppreference.com/w/c/language/type#Compatible_types) with their // siblings in file2.c. It varies whether they have a canonical form that's // common to them both. typedef int localInt; typedef localInt intAlias; // has common `getUnderlyingType()` and `getUnspe...
660
40.3125
89
c
codeql
codeql-master/cpp/ql/test/library-tests/multiple_declarations/variable_types/extracted_once.h
// This header file is extracted only once even though it's included by both // file1.c and file2.c. That's presumably because it's wrongly considered to // expand to the same trap in both contexts. In practice, this header gets // extracted together with the extraction of file1.c. // BUG: types of members depend on e...
723
41.588235
80
h
codeql
codeql-master/cpp/ql/test/library-tests/multiple_declarations/variable_types/extracted_twice.h
// This header file is extracted twice because its inclusions in file1.c and // file2.c lead to different context hashes, seemingly because this file (unlike // extracted_once.h) refers to `structAlias`. That means the resulting trap has // two copies of all declarations in this file, and those copies have to be // uni...
1,513
47.83871
80
h
codeql
codeql-master/cpp/ql/test/library-tests/lossy_pointer_cast/lossy_pointer_cast.c
void f(void) { void *p1, *p2, *p3, *p4; short int i; long long int z; z = (long long int)p1; // OK: long long int is big enough i = (short int)p2; // Bad: short is too small i = (short int)(long long int)p3; // OK: we assume they know what ...
571
32.647059
73
c
codeql
codeql-master/cpp/ql/test/experimental/library-tests/rangeanalysis/signanalysis/minmax.c
// semmle-extractor-options: --gnu_version 40400 // Note: this file uses statement expressions, which are a GNU extension, // so it has an options file to specify the compiler version. The statement // expression extension is described here: // https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html int printf(const c...
748
25.75
75
c
codeql
codeql-master/cpp/ql/test/experimental/library-tests/rangeanalysis/signanalysis/inline_assembly.c
// The ASM statements are // causing problems, because our SSA analysis does not notice that they // might change the value of `x`. This was a latent bug that came out // of the woodwork when we added support for statement expressions. int printf(const char *format, ...); int main() { unsigned int x = 0, y; y = 1...
644
24.8
92
c
codeql
codeql-master/cpp/ql/test/query-tests/Critical/OverflowStatic/test2.c
/* Semmle test case for OverflowStatic.ql Associated with CWE-131 http://cwe.mitre.org/data/definitions/131.html Each query is expected to find exactly the lines marked BAD in the section corresponding to it. */ ///// Library functions ////// typedef struct {} FILE; typedef unsigned long size_t; typedef void...
1,737
33.078431
98
c
codeql
codeql-master/cpp/ql/test/query-tests/Architecture/Refactoring Opportunities/ComplexFunctions/complex.c
void f(void) { } void g(void) { f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); ...
1,165
45.64
73
c
codeql
codeql-master/cpp/ql/test/query-tests/Architecture/InappropriateIntimacy/a.c
#include "b.h" void f1(void) { g1(); } void f2(void) { g2(); } void f3(void) { g3(); } void f4(void) { g4(); } void f5(void) { g5(); } void f6(void) { g6(); } void f7(void) { g7(); } void f8(void) { g8(); } void f9(void) { g9(); } void f10(void) { g10(); } void f11(void) { g11(); } void f12(void) { g12(); } void f13(...
572
20.222222
25
c
codeql
codeql-master/cpp/ql/test/query-tests/AlertSuppression/tstWindows.c
int x = 0; // lgtm // lgtm[js/debugger-statement] // lgtm[js/debugger-statement, js/invocation-of-non-function] // lgtm[@tag:nullness] // lgtm[@tag:nullness,js/debugger-statement] // lgtm[@expires:2017-06-11] // lgtm[js/invocation-of-non-function] because I know better than lgtm // lgtm: blah blah // lgtm blah blah #fa...
954
24.810811
70
c
codeql
codeql-master/cpp/ql/test/query-tests/AlertSuppression/tst.c
int x = 0; // lgtm // lgtm[js/debugger-statement] // lgtm[js/debugger-statement, js/invocation-of-non-function] // lgtm[@tag:nullness] // lgtm[@tag:nullness,js/debugger-statement] // lgtm[@expires:2017-06-11] // lgtm[js/invocation-of-non-function] because I know better than lgtm // lgtm: blah blah // lgtm blah blah #fa...
954
24.810811
70
c
codeql
codeql-master/cpp/ql/test/query-tests/Best Practices/Hiding/LocalVariableHidesGlobalVariable/Hiding.c
int gi; extern int gj; static int gk; void f(void) { int i; if (1) { int j; if (1) if(1) { int k; if(1) { int i; // BAD (hides local) int j; // BAD (hides local) int k; // BAD (hides local)...
1,099
25.829268
91
c
codeql
codeql-master/cpp/ql/test/query-tests/jsf/4.13 Functions/AV Rule 107/test.c
#define MY_FUNCTION_1() \ void my_function_1(); #define MY_FUNCTION2() \ void my_function_2() #define MYTYPE int void test1() { void inner1(); // BAD extern int inner2(); // BAD void inner3() {}; // GOOD (this isn't a declaration, it's a GCC nested function) MY_FUNCTION_1(); // GOOD (in a macro) MY_FUNCTION_...
623
22.111111
81
c
codeql
codeql-master/cpp/ql/test/query-tests/jsf/3.02 Code Size and Complexity/AV Rule 1/AV Rule 1.c
int good1() { good1(); } int good2() { good2(); // 199 bottles of beer on the wall // 198 bottles of beer on the wall // 197 bottles of beer on the wall // 196 bottles of beer on the wall // 195 bottles of beer on the wall // 194 bottles of beer on the wall // 193 bottles of beer on the wall // 192 bottles o...
13,316
20.759804
35
c
codeql
codeql-master/cpp/ql/test/query-tests/JPL_C/LOC-4/Rule 30/FunctionPointerConversions/test.c
// test.c void myFunc1(); typedef void (*voidFunPtr)(); void test() { void (*funPtr1)() = &myFunc1; // GOOD voidFunPtr funPtr2 = &myFunc1; // GOOD int *intPtr = &myFunc1; // BAD (function pointer -> int pointer) void *voidPtr = &myFunc1; // BAD (function pointer -> void pointer) int i = &myFunc1; // GOOD (permi...
1,041
30.575758
76
c
codeql
codeql-master/cpp/ql/test/query-tests/JPL_C/LOC-3/Rule 13/LimitedScopeFunction/test.c
// test.c #include "test.h" int globalInt1; // GOOD [used in func1, func2] int globalInt2; // GOOD [used in func1, func2] int globalInt3; // GOOD [used in func1, func2] int globalInt4; // BAD [only used in func1] int globalInt5; // BAD [only used in func1] int globalInt6; // BAD [only used in func1] int globalInt7; /...
1,051
22.377778
71
c
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Arithmetic/IntMultToLong/IntMultToLong.c
long long f(short x, int y, long long z) { y == x * x; // safe y == x * (int)x; // safe z == y * x; // unsafe z == (long long)(y * x); // we assume the user knows what they are doing if(x == 56) return y * y; // unsafe if(x == 56) return (long long)(y * y); /...
4,498
34.148438
121
c
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Memory Management/Padding/Suboptimal64BitType/types.c
// Badly laid out struct. Layout: // - 4 bytes: int a // - 4 bytes: padding // - 8 bytes: double b // - 4 bytes: int c // - 4 bytes: padding // - 6 bytes: char d[6] // - 2 bytes: trailing padding // Optimal layout removes 8 bytes padding, leaves 2 bytes trailing padding. typedef struct a { int a; double b; int c; ...
621
21.214286
75
c
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Memory Management/SuspiciousCallToStrncat/test.c
/* Semmle test case for SuspiciousCallToStrncat.ql Associated with CWE-131 http://cwe.mitre.org/data/definitions/131.html Each query is expected to find exactly the lines marked BAD in the section corresponding to it. */ ///// Library functions ////// typedef unsigned long size_t; char *strcpy(char *s1, const c...
1,233
28.380952
98
c
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Memory Management/AllocaInLoop/AllocaInLoop2.c
// semmle-extractor-options: --clang int printf(const char *restrict format, ...); int sprintf(char *restrict s, const char *restrict format, ...); typedef unsigned long long size_t; void *memcpy(void *restrict s1, const void *restrict s2, size_t n); void *malloc(size_t size); void free(void *ptr); struct vtype { int ...
3,792
22.855346
76
c
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Memory Management/UnsafeUseOfStrcat/strcat.c
extern void fiddle_with_string(const char **pstr); void f(void) { const char *str1 = "my string"; const char *str2 = "my other string"; const char *str3 = "yet another string"; char output1[100]; char output2[100]; char output3[100]; char output4[100]; str2 = "yet another string"; ...
618
22.807692
60
c
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Memory Management/SuspiciousCallToMemset/doc_tests.c
// tests from the qldoc page typedef unsigned int size_t; void *memset(void *ptr, int value, size_t num); struct S { char *a, *b, *c, *d, *e; }; struct T { int data[96]; }; void tests() { // correct, memset uses sizeof(type) int is[10]; memset(is, 0, sizeof(is)); // GOOD struct S s; memset(&s, 0, sizeof(stru...
797
21.8
72
c
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Memory Management/StrncpyFlippedArgs/test.c
/* Semmle test case for StrncpyFlippedArgs.ql Associated with CWE-131 http://cwe.mitre.org/data/definitions/131.html Each query is expected to find exactly the lines marked BAD in the section corresponding to it. */ ///// Library functions ////// extern char *strncpy(char *dest, const char *src, unsigned int s...
829
22.055556
98
c
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Format/WrongNumberOfFormatArguments/test.c
extern int printf(const char *fmt, ...); void test(int i, const char *str) { printf("\n"); // GOOD printf("\n", i); // BAD (too many format arguments) printf("%i\n"); // BAD (too few format arguments) printf("%i\n", i); // GOOD printf("%*s\n", str); // BAD (too few format arguments) printf("%*s\n", i, str); ...
1,478
31.152174
101
c
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Format/NonConstantFormat/NonConstantFormat.c
extern int printf(const char *fmt, ...); extern char *gettext (const char *__msgid); extern char *dgettext (const char *__domainname, const char *__msgid); extern char *dcgettext (const char *__domainname, const char *__msgid, int __category); extern char *ngettext (const char *__msgid1, c...
1,474
28.5
78
c
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Format/NonConstantFormat/performance.c
// This is a regression test. It must be run with the `--optimize` flag to the // test driver. #define d0(p) p, #define d1(p) d0(p"0") d0(p"1") d0(p"2") d0(p"3") d0(p"4") d0(p"5") #define d2(p) d1(p"0") d1(p"1") d1(p"2") d1(p"3") d1(p"4") d1(p"5") #define d3(p) d2(p"0") d2(p"1") d2(p"2") d2(p"3") d2(p"4") d2(p"5") #de...
682
39.176471
78
c
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Format/WrongTypeFormatArguments/Microsoft/wide_string.h
typedef wchar_t MYWCHAR; void test_wchar1(wchar_t *wstr) { printf("%ws\n", wstr); // GOOD } #ifdef TEST_MICROSOFT void test_wchar2(__wchar_t *wstr) { printf("%ws\n", wstr); // GOOD } #endif void test_wchar3(MYWCHAR *wstr) { printf("%ws\n", wstr); // GOOD } void test_wchar4(char c, const char cc, wchar_t wc,...
686
21.16129
72
h
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Format/WrongTypeFormatArguments/Microsoft/printf1.h
typedef enum { MYONETHOUSAND = 1000 } myenum; typedef int MYINT; void f(char *s, int i, unsigned char *us, const char *cs, signed char *ss, char c, MYINT mi, unsigned long long ull) { const char cc = 'x'; printf("%s: %d\n", s, i); // ok printf("%s: %f\n", s, i); // not ok (int -> float) p...
5,673
27.512563
118
h
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Format/WrongTypeFormatArguments/Linux_unsigned_chars/wide_string.h
typedef wchar_t MYWCHAR; void test_wchar1(wchar_t *wstr) { printf("%ws\n", wstr); // GOOD } #ifdef TEST_MICROSOFT void test_wchar2(__wchar_t *wstr) { printf("%ws\n", wstr); // GOOD } #endif void test_wchar3(MYWCHAR *wstr) { printf("%ws\n", wstr); // GOOD } void test_wchar4(char c, const char cc, wchar_t wc,...
701
21.645161
72
h
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Format/WrongTypeFormatArguments/Linux_unsigned_chars/printf1.h
typedef enum { MYONETHOUSAND = 1000 } myenum; typedef int MYINT; void f(char *s, int i, unsigned char *us, const char *cs, signed char *ss, char c, MYINT mi, unsigned long long ull) { const char cc = 'x'; printf("%s: %d\n", s, i); // ok printf("%s: %f\n", s, i); // not ok (int -> float) p...
5,115
28.234286
118
h
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Format/WrongTypeFormatArguments/Linux_signed_chars/b.c
__attribute__((format(printf, 2, 3))) void myMultiplyDefinedPrintf(const char *extraArg, const char *format, ...); // this declaration does not match the definition __attribute__((format(printf, 2, 3))) void myMultiplyDefinedPrintf2(const char *extraArg, const char *format, ...); void test_custom_printf2() { myMul...
690
48.357143
130
c
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Format/WrongTypeFormatArguments/Linux_signed_chars/a.c
__attribute__((format(printf, 1, 3))) void myMultiplyDefinedPrintf(const char *format, const char *extraArg, ...) { // ... } __attribute__((format(printf, 1, 3))) void myMultiplyDefinedPrintf2(const char *format, const char *extraArg, ...); void test_custom_printf1() { myMultiplyDefinedPrintf("%i", "%f", 1); // GO...
651
37.352941
130
c
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Format/WrongTypeFormatArguments/Linux_signed_chars/wide_string.h
typedef wchar_t MYWCHAR; void test_wchar1(wchar_t *wstr) { printf("%ws\n", wstr); // GOOD } #ifdef TEST_MICROSOFT void test_wchar2(__wchar_t *wstr) { printf("%ws\n", wstr); // GOOD } #endif void test_wchar3(MYWCHAR *wstr) { printf("%ws\n", wstr); // GOOD } void test_wchar4(char c, const char cc, wchar_t wc,...
701
21.645161
72
h
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Format/WrongTypeFormatArguments/Linux_signed_chars/printf1.h
typedef enum { MYONETHOUSAND = 1000 } myenum; typedef int MYINT; void f(char *s, int i, unsigned char *us, const char *cs, signed char *ss, char c, MYINT mi, unsigned long long ull) { const char cc = 'x'; printf("%s: %d\n", s, i); // ok printf("%s: %f\n", s, i); // not ok (int -> float) p...
6,733
27.413502
118
h
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Format/WrongTypeFormatArguments/Microsoft_no_wchar/wide_string.h
typedef wchar_t MYWCHAR; void test_wchar1(wchar_t *wstr) { printf("%ws\n", wstr); // GOOD } #ifdef TEST_MICROSOFT void test_wchar2(__wchar_t *wstr) { printf("%ws\n", wstr); // GOOD } #endif void test_wchar3(MYWCHAR *wstr) { printf("%ws\n", wstr); // GOOD } void test_wchar4(char c, const char cc, wchar_t wc,...
686
21.16129
72
h
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Format/WrongTypeFormatArguments/Microsoft_no_wchar/printf1.h
typedef enum { MYONETHOUSAND = 1000 } myenum; typedef int MYINT; void f(char *s, int i, unsigned char *us, const char *cs, signed char *ss, char c, MYINT mi, unsigned long long ull) { const char cc = 'x'; printf("%s: %d\n", s, i); // ok printf("%s: %f\n", s, i); // not ok (int -> float) p...
5,000
27.907514
118
h
codeql
codeql-master/cpp/ql/test/query-tests/Likely Bugs/Underspecified Functions/test.c
void declared_empty(); void declared_void(void); void declared_with(int); void declared_empty_defined_with(); void declared_with_pointers(); void declared_with_array(); void declared_and_defined_empty(); int k_and_r_func(c,d) char c; double d; { return c + d; } struct _s { int a, b; } s; int ca[4] = { 1, 2, 3,...
3,415
23.753623
115
c
codeql
codeql-master/cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/test3.c
// semmle-extractor-options: -isystem ${testdir}/../system_header #include <system_header.h> #define CAST(c) ((int)(unsigned char)(c)) // Regression test for ODASA-6054: IntegerOverflowTainted should // not report a result if the overflow happens in a macro expansion // from a macro that is defined in a system heade...
647
37.117647
95
c
codeql
codeql-master/cpp/ql/test/query-tests/Security/CWE/CWE-676/semmle/PotentiallyDangerousFunction/test.c
// Semmle test case for rule PotentiallyDangerousFunction.ql // Associated with CWE-676: Use of Potentially Dangerous Function. http://cwe.mitre.org/data/definitions/676.html // Standard library definitions #define NULL (0) typedef unsigned long size_t; typedef size_t time_t; struct tm { int tm_sec; // seconds a...
1,482
27.519231
113
c
codeql
codeql-master/cpp/ql/test/query-tests/Security/CWE/CWE-079/semmle/CgiXss/search.c
// Semmle test case for rule CgiXss.ql (CGI script vulnerable to cross-site scripting) // Associated with CWE-079: Cross-site Scripting. http://cwe.mitre.org/data/definitions/79.html // Standard library routines void free(void *ptr); char *getenv(const char *name); int printf(const char *format, ...); int puts(const c...
1,305
24.607843
95
c
codeql
codeql-master/cpp/ql/test/query-tests/Security/CWE/CWE-120/semmle/tests/unions.c
//semmle-extractor-options: --edg --target --edg win64 // Semmle test cases for UnboundedWrite.ql, BadlyBoundedWrite.ql, OverrunWrite.ql and OverrunWriteFloat.ql // Associated with CWE-120 http://cwe.mitre.org/data/definitions/120.html // Each query is expected to find exactly the lines marked BAD in the section corres...
1,048
29.852941
106
c
codeql
codeql-master/cpp/ql/test/query-tests/Security/CWE/CWE-120/semmle/tests/tests.c
//semmle-extractor-options: --edg --target --edg win64 // Semmle test cases for UnboundedWrite.ql, BadlyBoundedWrite.ql, OverrunWrite.ql and OverrunWriteFloat.ql // Associated with CWE-120 http://cwe.mitre.org/data/definitions/120.html // Each query is expected to find exactly the lines marked BAD in the section corres...
4,965
27.872093
122
c
codeql
codeql-master/cpp/ql/test/query-tests/Security/CWE/CWE-120/semmle/UnsafeUseOfStrcat/test.c
/* Semmle test case for UnsafeUseOfStrcat.ql Associated with CWE-120 http://cwe.mitre.org/data/definitions/120.html Each query is expected to find exactly the lines marked BAD in the section corresponding to it. */ ///// Library functions ////// typedef unsigned long size_t; char *strcpy(char *s1, const char *...
1,035
23.666667
98
c
codeql
codeql-master/cpp/ql/test/query-tests/Security/CWE/CWE-131/semmle/NoSpaceForZeroTerminator/test.c
/* Semmle test case for NoSpaceForZeroTerminator.ql Associated with CWE-131 http://cwe.mitre.org/data/definitions/131.html Each query is expected to find exactly the lines marked BAD in the section corresponding to it. */ ///// Library functions ////// typedef unsigned long size_t; void *malloc(size_t size); vo...
2,053
22.609195
98
c
codeql
codeql-master/cpp/ql/test/query-tests/Security/CWE/CWE-131/semmle/SizeCheck2/test.c
/* Semmle test case for SizeCheck2.ql Associated with CWE-131 http://cwe.mitre.org/data/definitions/131.html Each query is expected to find exactly the lines marked BAD in the section corresponding to it. */ ///// Library functions ////// typedef unsigned long size_t; void *malloc(size_t size); void free(void ...
1,198
23.979167
98
c
codeql
codeql-master/cpp/ql/test/query-tests/Security/CWE/CWE-131/semmle/SizeCheck/test.c
/* Semmle test case for SizeCheck.ql Associated with CWE-131 http://cwe.mitre.org/data/definitions/131.html Each query is expected to find exactly the lines marked BAD in the section corresponding to it. */ ///// Library functions ////// typedef unsigned long size_t; void *malloc(size_t size); void free(void *...
1,030
20.479167
98
c
codeql
codeql-master/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/stdlib.h
// Semmle test case for rule TaintedPath.ql (User-controlled data in path expression) // Associated with CWE-022: Improper Limitation of a Pathname to a Restricted Directory. http://cwe.mitre.org/data/definitions/22.html ///// Library routines ///// typedef struct {} FILE; #define FILENAME_MAX 1000 typedef unsigned l...
514
35.785714
134
h
codeql
codeql-master/cpp/ql/test/query-tests/Security/CWE/CWE-022/semmle/tests/test.c
// Semmle test case for rule TaintedPath.ql (User-controlled data in path expression) // Associated with CWE-022: Improper Limitation of a Pathname to a Restricted Directory. http://cwe.mitre.org/data/definitions/22.html #include "stdlib.h" ///// Test code ///// int main(int argc, char** argv) { char *userAndFile ...
869
27.064516
134
c
codeql
codeql-master/cpp/ql/test/query-tests/Security/CWE/CWE-134/semmle/globalVars/globalVars.c
// Semmle test case for rule UncontrolledFormatStringThroughGlobalVar.ql (Uncontrolled format string (through global variable)). // Associated with CWE-134: Uncontrolled format string. http://cwe.mitre.org/data/definitions/134.html // This file tests different ways to track argv usage to printf calls through global var...
1,240
22.865385
128
c
codeql
codeql-master/cpp/ql/test/query-tests/Security/CWE/CWE-134/semmle/ifs/ifs.c
// Semmle test case for rule UncontrolledFormatString.ql (Uncontrolled format string). // Associated with CWE-134: Uncontrolled format string. http://cwe.mitre.org/data/definitions/134.html // This file tests different ways to ignore branchs in code that will never be executed. int printf(const char *format, ...); int...
2,969
21.330827
128
c
codeql
codeql-master/cpp/ql/test/query-tests/Security/CWE/CWE-134/semmle/argv/argvLocal.c
// Semmle test case for rule UncontrolledFormatString.ql (Uncontrolled format string). // Associated with CWE-134: Uncontrolled format string. http://cwe.mitre.org/data/definitions/134.html // This file tests different ways to use argv as an argument to printf. typedef unsigned long size_t; int printf(const char *form...
3,668
20.331395
102
c
codeql
codeql-master/cpp/ql/test/query-tests/Security/CWE/CWE-078/semmle/ExecTainted/test.c
// Semmle test case for rule ExecTainted.ql (Uncontrolled data used in OS command) // Associated with CWE-078: OS Command Injection. http://cwe.mitre.org/data/definitions/78.html ///// Library routines ///// int sprintf(char *s, const char *format, ...); int system(const char *string); extern void encodeShellString(...
932
26.441176
95
c
wrs
wrs-master/extlib/stocc/randomc.h
/***************************** randomc.h ********************************** * Author: Agner Fog * Date created: 1997 * Last modified: 2008-11-16 * Project: randomc.h * Source URL: www.agner.org/random * * Description: * This header file contains class declarations and other definitions for the * r...
7,432
36.165
88
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/wrapper/ArWrapper/ArWrapper.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,863
32.890909
120
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/wrapper/AbstractWrapperLib/inc/paramsup/LnParamsup.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,357
29.177778
116
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/wrapper/AbstractWrapperLib/inc/abstractwrapper/AbstractArchive.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
2,690
38
128
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/wrapper/AbstractWrapperLib/inc/abstractwrapper/AbstractFilesystemLinker.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,792
28.393443
116
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/wrapper/LibWrapper/LibWrapper.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,873
33.072727
120
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/wrapper/LinkWrapper/LinkWrapper.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,873
33.072727
117
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/wrapper/AsWrapper/AsWrapper.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,296
27.822222
85
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/wrapper/AnalyzerWrapperConfig/AnalyzerWrapperConfig.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
3,111
42.830986
131
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/wrapper/LdWrapper/LdWrapper.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,857
32.781818
117
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/inc/Environment.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,338
34.236842
90
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/inc/Exception.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
2,578
26.731183
106
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/inc/LanguageCommon.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,121
26.365854
85
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/inc/ReleaseVersion.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
950
31.793103
125
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/inc/ErrorCodes.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,667
24.272727
85
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/JSAN2ChangePath/inc/messages.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,280
40.322581
113
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/MetricHunter/inc/ThresholdReader.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,877
25.083333
118
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/MetricHunter/inc/Helper.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,061
27.702703
102
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/JSAN2Lim/inc/HalsteadVisitor.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
14,631
53.192593
105
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/Pylint2Graph/inc/PylintRulMaker.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,018
28.114286
114
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DCF-CPP/inc/Aligner.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
866
24.5
85
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DCF-CPP/inc/RepeatingLinesFilter.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,294
26.553191
91
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DCF-CPP/inc/CloneOccuranceFilter.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,295
27.8
93
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DCF-CPP/inc/CloneLengthFilter.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,200
26.930233
85
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DCF-CPP/inc/Types.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
2,217
22.104167
88
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DCF-CPP/inc/Config.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
4,704
35.757813
128
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DCF-CPP/inc/LanguageFactory.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,779
25.969697
85
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DCF-CPP/inc/ClonePositioned.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
3,548
27.853659
93
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DCF-CPP/inc/StatementFilter.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,162
28.075
86
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DCF-CPP/inc/DistanceVisitor.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
2,965
24.135593
117
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DCF-CPP/inc/AbstractFilter.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,385
25.653846
85
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DCF-CPP/inc/Interval.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
2,066
23.903614
85
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DuplicatedCodeFinder/inc/Aligner.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
866
24.5
85
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DuplicatedCodeFinder/inc/RepeatingLinesFilter.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,229
29
96
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DuplicatedCodeFinder/inc/CloneOccuranceFilter.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,295
27.8
93
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DuplicatedCodeFinder/inc/CloneLengthFilter.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,200
26.930233
85
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DuplicatedCodeFinder/inc/Config.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
4,752
37.959016
127
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DuplicatedCodeFinder/inc/ClonePositioned.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
2,613
29.752941
93
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DuplicatedCodeFinder/inc/types.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
2,986
34.559524
85
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DuplicatedCodeFinder/inc/StatementFilter.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,171
29.051282
91
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DuplicatedCodeFinder/inc/AbstractFilter.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,377
25.5
85
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DuplicatedCodeFinder/inc/Interval.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
2,066
23.903614
85
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DuplicatedCodeFinder/inc/Visitors/NamedVisitor.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
2,246
27.443038
85
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DuplicatedCodeFinder/inc/Visitors/JCoverageVisitor.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,278
30.975
103
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DuplicatedCodeFinder/inc/Visitors/NodeEmbeddednessVisitorBase.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
4,633
34.374046
123
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DuplicatedCodeFinder/inc/Visitors/JSCoverageVisitor.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,271
29.285714
108
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DuplicatedCodeFinder/inc/Visitors/CSCoverageVisitor.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
1,294
29.833333
106
h
OpenStaticAnalyzer
OpenStaticAnalyzer-master/cl/DuplicatedCodeFinder/inc/Visitors/DistanceVisitor.h
/* * This file is part of OpenStaticAnalyzer. * * Copyright (c) 2004-2018 Department of Software Engineering - University of Szeged * * Licensed under Version 1.2 of the EUPL (the "Licence"); * * You may not use this work except in compliance with the Licence. * * You may obtain a copy of the Licence in t...
2,030
24.074074
98
h