mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
Adding test cases.
This commit is contained in:
@@ -31,4 +31,26 @@ void Test()
|
||||
|
||||
fconstWChar((LPCWSTR)lpWchar); // Valid
|
||||
fWChar(lpWchar); // Valid
|
||||
}
|
||||
|
||||
void NewBufferFalsePositiveTest()
|
||||
{
|
||||
wchar_t *lpWchar = NULL;
|
||||
|
||||
lpWchar = (LPWSTR)new char[56]; // Possible False Positive
|
||||
}
|
||||
|
||||
typedef unsigned char BYTE;
|
||||
typedef BYTE* PBYTE;
|
||||
|
||||
void NonStringFalsePositiveTest1(PBYTE buffer)
|
||||
{
|
||||
wchar_t *lpWchar = NULL;
|
||||
lpWchar = (LPWSTR)buffer; // Possible False Positive
|
||||
}
|
||||
|
||||
void NonStringFalsePositiveTest2(unsigned char* buffer)
|
||||
{
|
||||
wchar_t *lpWchar = NULL;
|
||||
lpWchar = (LPWSTR)buffer; // Possible False Positive
|
||||
}
|
||||
Reference in New Issue
Block a user