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.
char
1 parent c4737c7 commit 51e787bCopy full SHA for 51e787b
cpp/ql/src/Security/CWE/CWE-704/WcharCharConversion.ql
@@ -37,7 +37,9 @@ Type getABaseType(Type t) {
37
class UnlikelyToBeAStringType extends Type {
38
UnlikelyToBeAStringType() {
39
exists(Type targ |
40
- targ.(CharType).isUnsigned() or
+ // NOTE: not using CharType isUnsigned, but rather look for any explicitly declared unsigned
41
+ // char types. Assuming these are used for buffers, not strings.
42
+ targ.(CharType).getName().toLowerCase().matches(["unsigned%"]) or
43
targ.getName().toLowerCase().matches(["uint8_t", "%byte%"])
44
|
45
getABaseType(this) = targ
0 commit comments