mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Merge branch 'master' into overflowcalc
This commit is contained in:
@@ -55,3 +55,9 @@ void f(void) {
|
||||
}
|
||||
}
|
||||
|
||||
// This pattern is used to emulate C++20 concepts in a way that's very light on
|
||||
// template syntax.
|
||||
template<typename T1, typename T2>
|
||||
auto sfinaeTrick(T1 x1, T2 x2) -> decltype(x1 == x2, bool()) { // GOOD
|
||||
return x1 == x2;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
| test.c:25:5:25:16 | ... ? ... : ... | This expression has no effect. | test.c:25:5:25:16 | ... ? ... : ... | |
|
||||
| test.c:26:15:26:16 | 32 | This expression has no effect. | test.c:26:15:26:16 | 32 | |
|
||||
| test.c:27:9:27:10 | 33 | This expression has no effect. | test.c:27:9:27:10 | 33 | |
|
||||
| test.cpp:24:3:24:3 | call to operator++ | This expression has no effect (because $@ has no external side effects). | test.cpp:9:14:9:23 | operator++ | operator++ |
|
||||
| test.cpp:25:3:25:3 | call to operator++ | This expression has no effect (because $@ has no external side effects). | test.cpp:9:14:9:23 | operator++ | operator++ |
|
||||
| test.cpp:62:5:62:5 | call to operator= | This expression has no effect (because $@ has no external side effects). | test.cpp:47:14:47:22 | operator= | operator= |
|
||||
| test.cpp:65:5:65:5 | call to operator= | This expression has no effect (because $@ has no external side effects). | test.cpp:55:7:55:7 | operator= | operator= |
|
||||
| volatile.c:9:5:9:5 | c | This expression has no effect. | volatile.c:9:5:9:5 | c | |
|
||||
|
||||
@@ -21,8 +21,8 @@ public:
|
||||
MyIterator arg1, arg2;
|
||||
_It arg3;
|
||||
|
||||
++arg1; // pure, does nothing
|
||||
++arg2; // pure, does nothing
|
||||
++arg1; // pure, does nothing [NOT DETECTED]
|
||||
++arg2; // pure, does nothing [NOT DETECTED]
|
||||
++arg3; // not pure in all cases (when _It is int this has a side-effect)
|
||||
|
||||
return arg2;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
| test2.cpp:52:32:52:65 | call to context | Usage of $@ with protocol $@ is not configured correctly: The option $@. | test2.cpp:52:32:52:65 | call to context | boost::asio::ssl::context::context | test2.cpp:52:32:52:64 | sslv23 | sslv23 | test2.cpp:52:32:52:65 | call to context | no_sslv3 has not been set |
|
||||
| test2.cpp:52:32:52:65 | call to context | Usage of $@ with protocol $@ is not configured correctly: The option $@. | test2.cpp:52:32:52:65 | call to context | boost::asio::ssl::context::context | test2.cpp:52:32:52:64 | sslv23 | sslv23 | test2.cpp:52:32:52:65 | call to context | no_tlsv1 has not been set |
|
||||
| test2.cpp:52:32:52:65 | call to context | Usage of $@ with protocol $@ is not configured correctly: The option $@. | test2.cpp:52:32:52:65 | call to context | boost::asio::ssl::context::context | test2.cpp:52:32:52:64 | sslv23 | sslv23 | test2.cpp:52:32:52:65 | call to context | no_tlsv1_1 has not been set |
|
||||
| test3.cpp:7:32:7:62 | call to context | Usage of $@ with protocol $@ is not configured correctly: The option $@. | test3.cpp:7:32:7:62 | call to context | boost::asio::ssl::context::context | test3.cpp:7:32:7:61 | tls | tls | test3.cpp:7:32:7:62 | call to context | no_tlsv1_1 has not been set |
|
||||
| test.cpp:25:32:25:65 | call to context | Usage of $@ with protocol $@ is not configured correctly: The option $@. | test.cpp:25:32:25:65 | call to context | boost::asio::ssl::context::context | test.cpp:25:32:25:64 | sslv23 | sslv23 | test.cpp:25:32:25:65 | call to context | no_sslv3 has not been set |
|
||||
| test.cpp:31:32:31:65 | call to context | Usage of $@ with protocol $@ is not configured correctly: The option $@. | test.cpp:31:32:31:65 | call to context | boost::asio::ssl::context::context | test.cpp:31:32:31:64 | sslv23 | sslv23 | test.cpp:31:32:31:65 | call to context | no_sslv3 has not been set |
|
||||
| test.cpp:31:32:31:65 | call to context | Usage of $@ with protocol $@ is not configured correctly: The option $@. | test.cpp:31:32:31:65 | call to context | boost::asio::ssl::context::context | test.cpp:31:32:31:64 | sslv23 | sslv23 | test.cpp:31:32:31:65 | call to context | no_tlsv1 has not been set |
|
||||
|
||||
@@ -65,13 +65,13 @@ void TestHardcodedProtocols()
|
||||
|
||||
////////////////////// Hardcoded algorithms
|
||||
|
||||
boost::asio::ssl::context cxt_tlsv12(boost::asio::ssl::context::tlsv12); // BUG
|
||||
boost::asio::ssl::context cxt_tlsv12c(boost::asio::ssl::context::tlsv12_client); // BUG
|
||||
boost::asio::ssl::context cxt_tlsv12s(boost::asio::ssl::context::tlsv12_server); // BUG
|
||||
boost::asio::ssl::context cxt_tlsv12(boost::asio::ssl::context::tlsv12);
|
||||
boost::asio::ssl::context cxt_tlsv12c(boost::asio::ssl::context::tlsv12_client);
|
||||
boost::asio::ssl::context cxt_tlsv12s(boost::asio::ssl::context::tlsv12_server);
|
||||
|
||||
boost::asio::ssl::context cxt_tlsv13(boost::asio::ssl::context::tlsv13); // BUG
|
||||
boost::asio::ssl::context cxt_tlsv13c(boost::asio::ssl::context::tlsv13_client); // BUG
|
||||
boost::asio::ssl::context cxt_tlsv13s(boost::asio::ssl::context::tlsv13_server); // BUG
|
||||
boost::asio::ssl::context cxt_tlsv13(boost::asio::ssl::context::tlsv13);
|
||||
boost::asio::ssl::context cxt_tlsv13c(boost::asio::ssl::context::tlsv13_client);
|
||||
boost::asio::ssl::context cxt_tlsv13s(boost::asio::ssl::context::tlsv13_server);
|
||||
}
|
||||
|
||||
void InterProceduralTest(boost::asio::ssl::context::method m)
|
||||
@@ -100,11 +100,11 @@ void TestHardcodedProtocols_inter()
|
||||
|
||||
////////////////////// Hardcoded algorithms
|
||||
|
||||
InterProceduralTest(boost::asio::ssl::context::tlsv12); // BUG
|
||||
InterProceduralTest(boost::asio::ssl::context::tlsv12_client); // BUG
|
||||
InterProceduralTest(boost::asio::ssl::context::tlsv12_server); // BUG
|
||||
InterProceduralTest(boost::asio::ssl::context::tlsv12);
|
||||
InterProceduralTest(boost::asio::ssl::context::tlsv12_client);
|
||||
InterProceduralTest(boost::asio::ssl::context::tlsv12_server);
|
||||
|
||||
InterProceduralTest(boost::asio::ssl::context::tlsv13); // BUG
|
||||
InterProceduralTest(boost::asio::ssl::context::tlsv13_client); // BUG
|
||||
InterProceduralTest(boost::asio::ssl::context::tlsv13_server); // BUG
|
||||
InterProceduralTest(boost::asio::ssl::context::tlsv13);
|
||||
InterProceduralTest(boost::asio::ssl::context::tlsv13_client);
|
||||
InterProceduralTest(boost::asio::ssl::context::tlsv13_server);
|
||||
}
|
||||
|
||||
19
cpp/ql/test/query-tests/Likely Bugs/Protocols/test3.cpp
Normal file
19
cpp/ql/test/query-tests/Likely Bugs/Protocols/test3.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "asio/boost_simulation.hpp"
|
||||
|
||||
// examples from the qhelp...
|
||||
|
||||
void useTLS_bad()
|
||||
{
|
||||
boost::asio::ssl::context ctx(boost::asio::ssl::context::tls);
|
||||
ctx.set_options(boost::asio::ssl::context::no_tlsv1); // BAD: missing no_tlsv1_1
|
||||
|
||||
// ...
|
||||
}
|
||||
|
||||
void useTLS_good()
|
||||
{
|
||||
boost::asio::ssl::context ctx(boost::asio::ssl::context::tls);
|
||||
ctx.set_options(boost::asio::ssl::context::no_tlsv1 | boost::asio::ssl::context::no_tlsv1_1); // GOOD
|
||||
|
||||
// ...
|
||||
}
|
||||
Reference in New Issue
Block a user