Skip to content

Commit 38820bd

Browse files
authored
Suppress false positive CodeQL errors (#1013)
* suppress false positive codeQL generated errors * add suppression justification * fixed typo
1 parent c13cf9d commit 38820bd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/http/HttpClient_CAPI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ namespace MAT_NS_BEGIN {
186186
void HttpClient_CAPI::CancelRequestAsync(const std::string& id)
187187
{
188188
LOG_TRACE("Cancelling CAPI HTTP request '%s'", id.c_str());
189-
std::shared_ptr<HttpClient_Operation> operation;
189+
std::shared_ptr<HttpClient_Operation> operation(nullptr);
190190
{
191191
// Only lock mutex while actually reading/writing pending operations collection to prevent potential recursive deadlock
192192
LOCKGUARD(s_operationsLock);
@@ -199,7 +199,7 @@ namespace MAT_NS_BEGIN {
199199

200200
if (operation != nullptr)
201201
{
202-
operation->Cancel();
202+
operation->Cancel();// CodeQL [cpp/uninitializedptrfield] operation is explicitly constructed with nullptr so it will never hold garbage value
203203
}
204204
}
205205

lib/include/mat/json.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6842,7 +6842,7 @@ class lexer : public lexer_base<BasicJsonType>
68426842
locale's decimal point is used instead of `.` to work with the
68436843
locale-dependent converters.
68446844
*/
6845-
token_type scan_number() // lgtm [cpp/use-of-goto]
6845+
token_type scan_number() // CodeQL [cpp/use-of-goto] We explicitly allow the use of goto in this func
68466846
{
68476847
// reset token_buffer to store the number's bytes
68486848
reset();

0 commit comments

Comments
 (0)