Skip to content

Commit 31324fc

Browse files
committed
Altering ordering for exists statement to be clearer.
1 parent 51e787b commit 31324fc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cpp/ql/src/Security/CWE/CWE-704/WcharCharConversion.ql

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,11 @@ Type getABaseType(Type t) {
3636
*/
3737
class UnlikelyToBeAStringType extends Type {
3838
UnlikelyToBeAStringType() {
39-
exists(Type targ |
40-
// NOTE: not using CharType isUnsigned, but rather look for any explicitly declared unsigned
39+
exists(Type targ | getABaseType(this) = targ |
40+
// NOTE: not using CharType isUnsigned, but rather look for any explicitly declared unsigned
4141
// char types. Assuming these are used for buffers, not strings.
4242
targ.(CharType).getName().toLowerCase().matches(["unsigned%"]) or
4343
targ.getName().toLowerCase().matches(["uint8_t", "%byte%"])
44-
|
45-
getABaseType(this) = targ
4644
)
4745
}
4846
}

0 commit comments

Comments
 (0)