Skip to content

Commit d61fcfc

Browse files
authored
Add files via upload
1 parent 460fde7 commit d61fcfc

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| test.cpp:23:3:23:11 | call to funcTest1 | There is an exception in the function that requires your attention. |
2+
| test.cpp:24:3:24:9 | call to DllMain | DllMain contains exeption no wrapped to try..catch blocks. |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
experimental/Security/CWE/CWE-703/FindIncorrectlyUsedExceptions.ql
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
typedef unsigned int size_t;
2+
void clean();
3+
4+
5+
void funcTest1()
6+
{
7+
throw ("my exception!",546); // BAD
8+
}
9+
10+
void DllMain()
11+
{
12+
try { throw "my exception!"; } // BAD
13+
catch (...) { }
14+
}
15+
16+
void funcTest2()
17+
{
18+
try { throw "my exception!"; } // GOOD
19+
catch (...) { clean(); }
20+
}
21+
void TestFunc()
22+
{
23+
funcTest1();
24+
DllMain();
25+
funcTest2();
26+
}

0 commit comments

Comments
 (0)