mirror of
https://github.com/github/codeql.git
synced 2025-12-19 18:33:16 +01:00
Use stripTopLevelSpecifiers() to get the allocated element type for malloc().
This commit is contained in:
@@ -343,7 +343,8 @@ class CallAllocationExpr extends AllocationExpr, FunctionCall {
|
||||
override Expr getReallocPtr() { result = getArgument(target.getReallocPtrArg()) }
|
||||
|
||||
override Type getAllocatedElementType() {
|
||||
result = this.getFullyConverted().getUnderlyingType().(PointerType).getBaseType() and
|
||||
result =
|
||||
this.getFullyConverted().getType().stripTopLevelSpecifiers().(PointerType).getBaseType() and
|
||||
not result instanceof VoidType
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user