mirror of
https://github.com/github/codeql.git
synced 2026-05-04 21:25:44 +02:00
Add files via upload
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
| test.cpp:23:3:23:11 | call to funcTest1 | There is an exception in the function that requires your attention. |
|
||||
| test.cpp:24:3:24:9 | call to DllMain | DllMain contains exeption no wrapped to try..catch blocks. |
|
||||
@@ -0,0 +1 @@
|
||||
experimental/Security/CWE/CWE-703/FindIncorrectlyUsedExceptions.ql
|
||||
@@ -0,0 +1,26 @@
|
||||
typedef unsigned int size_t;
|
||||
void clean();
|
||||
|
||||
|
||||
void funcTest1()
|
||||
{
|
||||
throw ("my exception!",546); // BAD
|
||||
}
|
||||
|
||||
void DllMain()
|
||||
{
|
||||
try { throw "my exception!"; } // BAD
|
||||
catch (...) { }
|
||||
}
|
||||
|
||||
void funcTest2()
|
||||
{
|
||||
try { throw "my exception!"; } // GOOD
|
||||
catch (...) { clean(); }
|
||||
}
|
||||
void TestFunc()
|
||||
{
|
||||
funcTest1();
|
||||
DllMain();
|
||||
funcTest2();
|
||||
}
|
||||
Reference in New Issue
Block a user