We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e12ede commit 4202759Copy full SHA for 4202759
cpp/ql/test/experimental/query-tests/Security/CWE/CWE-703/semmle/tests/test.cpp
@@ -1,3 +1,14 @@
1
+namespace std
2
+{
3
+ class exception {
4
+ };
5
+
6
+ class runtime_error : public exception {
7
+ public:
8
+ runtime_error(const char *msg);
9
10
+}
11
12
typedef unsigned int size_t;
13
void clean();
14
@@ -18,6 +29,13 @@ void funcTest2()
18
29
try { throw "my exception!"; } // GOOD
19
30
catch (...) { clean(); }
20
31
}
32
33
+void funcTest3()
34
35
+ std::runtime_error("msg error"); // BAD
36
+ throw std::runtime_error("msg error"); // GOOD
37
38
21
39
void TestFunc()
22
40
{
23
41
funcTest1();
0 commit comments