mirror of
https://github.com/github/codeql.git
synced 2026-05-03 20:58:03 +02:00
QL code and tests for C#/C++/JavaScript.
This commit is contained in:
14
cpp/ql/test/library-tests/string_analysis/StringAnalysis.ql
Normal file
14
cpp/ql/test/library-tests/string_analysis/StringAnalysis.ql
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* @name StringAnalysis
|
||||
* @kind table
|
||||
*/
|
||||
import cpp
|
||||
|
||||
from AnalysedString s, string str
|
||||
where
|
||||
if s.(StringLiteral).getType().getUnspecifiedType().(DerivedType).getBaseType() instanceof Wchar_t then (
|
||||
str = "[?]"
|
||||
) else (
|
||||
str = s.toString()
|
||||
)
|
||||
select s.getLocation().toString(), str, s.getMaxLength()
|
||||
Reference in New Issue
Block a user