mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
Switching to looking for explicit declaration of unsigned char, to avoid cases where unsigned char is the default char width for char.
This commit is contained in:
@@ -37,7 +37,9 @@ Type getABaseType(Type t) {
|
||||
class UnlikelyToBeAStringType extends Type {
|
||||
UnlikelyToBeAStringType() {
|
||||
exists(Type targ |
|
||||
targ.(CharType).isUnsigned() or
|
||||
// NOTE: not using CharType isUnsigned, but rather look for any explicitly declared unsigned
|
||||
// char types. Assuming these are used for buffers, not strings.
|
||||
targ.(CharType).getName().toLowerCase().matches(["unsigned%"]) or
|
||||
targ.getName().toLowerCase().matches(["uint8_t", "%byte%"])
|
||||
|
|
||||
getABaseType(this) = targ
|
||||
|
||||
Reference in New Issue
Block a user