Add files via upload

This commit is contained in:
ihsinme
2021-06-23 10:46:03 +03:00
committed by GitHub
parent 460fde72ff
commit d61fcfc84b
3 changed files with 29 additions and 0 deletions

View File

@@ -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. |

View File

@@ -0,0 +1 @@
experimental/Security/CWE/CWE-703/FindIncorrectlyUsedExceptions.ql

View File

@@ -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();
}